I have a silverlight application, it has pretty complex UI. In some forms I am using MVVM pattern. However there are many forms where code behind file has most of the form logic code (no view model).
Silverlight application is having both business and UI logic. There is a WCF service which SL application is directly calling. This WCF service is a data service (DB logic).
I want to migrate silverlight application into HTML5. I have following questions.
There are many links to migrate the SL application to HTML5 (even using MVVM pattern). Many suggests to use some JS framework library like AngularJS/Knockout. Can you please tell me which one works best for migration from SL?
Where would I put the business logic? Can I write my business logic using JS library? Also in case I write business logic using some library then won't it expose all my logic to client?
In case JS library is not the right thing to write the business logic then what other technology I should use? WebAPI or something else?
Atul Sureka
For Server Side Code Reusablity (MVVM) Code use AngularJS/KendoUI
Use C# Object to JavaScript Object Convrsion
Server Side Logic we can Re-Use, Client Side Logic C# to Java Script
User Rest API's
Related
Normally when developing in ASP.Net MVC, we put our Data Annotions on our POCOs and use isModel.Valid on the server side and unobtrusive jQuery validation on the front end so we don't have to duplicate and specify our validation requirements twice.
But I am about to try writing my first app with an Angular/Rest SPA architecture (ASP.Net Web API of course, more specifically, ASP.Net MVC Core).
Is there a way to get the Angular Forms to validate against the POCO validation attribute rules and keep it DRY? Or am I going to have to maintain it in both places? Client and Server.
What is the best practice here?
Can someone point me to an example if there is a correct way?
I am working on WPF Application.I am using Auto Mapper in WCF services. In My project I have different kind of layer like Service layer, Business Layer , Presentation Layer , I want to work on Service Layer that is (WCF).
In Auto Mapper there is creation of map
Mapper.Initialize(Item=> Item.CreateMap<Model.Person, PersonInfo>());
Mapper.Initialize(Item=> Item.CreateMap<Model.Bank, BankInfo>());
Mapper.Initialize(Item=> Item.CreateMap<Data, Model.DataInfo>());
When ever I call function at that every time it will call as per application perfomance.
I want to make as per global in application.That is Create once in application and use as many time as they can
How to Implement this concept of globalization at service layer in WPF application.
There is no concept of global.asax is WPF Application.then how to implement that concept of globalization of mapper initilization
Thank you.
We have an asp.net website running in our company. This website majorly use AJAX calls to interact with server and for that we have web methods in our code behind files.
Company is thinking to switch technology to Angular JS. I just want to know whether it is a good practice to use Angular JS with asp.net webforms or we have to convert from webforms to
asp.net MVC in order to switch to Angular JS? I have already read relevant questions but I need more specific answers, any one please put a light on this.
As I look at it, it doesn't really matter what you use, because angularjs is implemented using only javascript and html code, and in both cases I don't think that implementing it in either asp or mvc will have any major impact, this does depend on your project size and complexity but for the most part I don't think you will face any problems.Then again this is just my viewpoint on this matter.
I have an MVC webapp and am creating a Winforms app. The methods I have created and use in the MVC app will also be used by the Winforms app. Is there a way I can share the code between them so that I can update it all in one place? Maybe turn those methods into a dll that they both use? If so, how do I go about doing that?
I'm building a complex job application. And I want it to be a SPA. I'm using AngularJS with Asp.net MVC (not web API). Everything is working so far, but I realized that I can no longer take advantage of a lot of features that ASP.NET MVC provides. So far I know I have to write my own code for these features:
all validation have to be on client side. I can't reuse some attributes I wrote in C#.
[ValidateAntiForgeryToken] attribute no longer work.
I can't use classes that generated by entity framework directly. It will give "circular reference" error for that.
I almost regret to take this approach. It's nice to have 2-way binding, but I have to write a lot of extra code that I could have avoided if I don't use angularJS. I can write multiple forms in one page and achieve the same result like shown here:
Multiple Forms in same page ASP.net MVC.
Can you tell what other MVC features I still have to write code for? when should I use angularJS and when should I use ASP.NET multiple forms on the same page?
Thanks
You can ease the pain of those listed points, but still, it might be better to decide what's better for you from the beginning - rendering views client-side (angular) or server-side (mvc).
Anyways, there are known solutions for some of the listed issues. Angular directive for MVC validation attributes:
https://github.com/alisabzevari/ngval
For the [ValidationAntiForgeryToken] here is also a solution: https://julianjelfs.wordpress.com/category/mvc/
I have not understood the thing regarding multiple forms (I believe it's unrelated to angular), so skipped on this..