AngularJs Factory and Services. References: https://blog.thoughtram.io/angular/2015/07/07/service-vs-factory-once-and-for-all.html The difference between services and factories we can define a service like this: app . service ( 'MyService' , function () { this . sayHello = function () { console . log ( 'hello' ); }; }); .service() is a method on our module that takes a name and a function that defines the service. app . factory ( 'MyService' , function () { return { sayHello : function () { console . log ( 'hello' ); } } }); .factory() is a method on our module and it also takes a name and a function, that defines the factory. a service is a constructor function where as a factory is Not .T here’s ' this ' code that calls Object.create() with the service constructor function, when it gets instantiated. However, a factory function is really just a function that gets called, ...
Ref: https://code-maze.com/aspnetcore-webapi-best-practices/ In the Startup class, there are two methods: the ConfigureServices method for registering the services and the Configure method for adding the middleware components to the application’s pipeline. public static class ServiceExtensions { public static void ConfigureCors(this IServiceCollection services) { services.AddCors(options => { options.AddPolicy("CorsPolicy", builder => builder.AllowAnyOrigin() .AllowAnyMethod() .AllowAnyHeader() ...
Ref: https://www.nuget.org/packages/EnterpriseLibrary.Data.NetCore/ The Enterprise Library Data Access Application Block simplifies the development of tasks that implement common data access functionality. Applications can use this application block in a variety of situations, such as reading data for display, passing data through application layers, and submitting changed data back to the database system. This library contains a class library that targets .Net Core 2.0 & .Net Standard 2.0 Install-Package EnterpriseLibrary.Data.NetCore -Version 6.0.1313
Comments
Post a Comment