|
1 | 1 | <a href="http://incframework.com"><img class="aligncenter size-full wp-image-1738" src="http://blog.incframework.com/upload/IncFramework-logo.png" alt="IncFramework-logo" widht="100%" height="auto" /></a> |
2 | 2 |
|
3 | 3 | <p style="text-align: justify;"><strong>Incoding Framework</strong> is awesome tool for Full-stack development. Try it with our <a href="https://github.com/IncodingSoftware/get-started">Get Started guide</a></p> |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | +# Incoding Framework |
| 11 | + |
| 12 | +is the opensource library for rapid development web/desktop-applications. Incoding Framework can be used for resolving different kinds of issues - it supports all development life cycle. Incoding Framework helps make more things with less code: |
| 13 | + |
| 14 | +Incoding Framework supports different design patterns |
| 15 | +Framework provides base classes for using CQRS |
| 16 | +Meta Language allows to create "rich" client web-applications |
| 17 | +In framework you can find methods an classes for unit tests |
| 18 | + |
| 19 | +## Getting Started |
| 20 | + |
| 21 | +Configuring: |
| 22 | +``` |
| 23 | +public class IncodingStartup |
| 24 | + { |
| 25 | + public IncodingStartup(IConfiguration configuration) |
| 26 | + { |
| 27 | + Configuration = configuration; |
| 28 | + } |
| 29 | +
|
| 30 | + public IConfiguration Configuration { get; } |
| 31 | +
|
| 32 | + // This method gets called by the runtime. Use this method to add services to the container. |
| 33 | + public void ConfigureServices(IServiceCollection services) |
| 34 | + { |
| 35 | + services.AddMvc(options => |
| 36 | + { |
| 37 | + // Configure Error Handling for mvc controllers |
| 38 | + options.Filters.Add(new IncodingErrorHandlingFilter()); |
| 39 | + }) |
| 40 | + .AddFluentValidation(configuration => |
| 41 | + { |
| 42 | + // Setting up FluentValidation Validator Factory |
| 43 | + configuration.ValidatorFactory = new IncValidatorFactory(); |
| 44 | +
|
| 45 | + AssemblyScanner.FindValidatorsInAssemblyContaining<ItemEntityMap>().ForEach(result => |
| 46 | + { |
| 47 | + services.Add(ServiceDescriptor.Transient(result.InterfaceType, result.ValidatorType)); |
| 48 | + services.Add(ServiceDescriptor.Transient(result.ValidatorType, result.ValidatorType)); |
| 49 | + }); |
| 50 | + }); |
| 51 | + |
| 52 | + // Configure Core services |
| 53 | + services.ConfigureIncodingCoreServices(); |
| 54 | + |
| 55 | + // Configure Entity Framework (requires Incoding.Data.EF provider). You can use any existing provider implementation available in Incoding.Data.* on Nuget |
| 56 | + services.ConfigureIncodingEFDataServices(typeof(ItemEntity), builder => |
| 57 | + { |
| 58 | + builder.UseSqlServer(Configuration.GetConnectionString("Main")); |
| 59 | + }); |
| 60 | + |
| 61 | + // Configure Incoding Framework MVC services |
| 62 | + services.ConfigureIncodingWebServices(); |
| 63 | + } |
| 64 | +
|
| 65 | + // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. |
| 66 | + public void Configure(IApplicationBuilder app, IHostingEnvironment env, IApplicationLifetime applicationLifetime) |
| 67 | + { |
| 68 | + if (env.IsDevelopment()) |
| 69 | + { |
| 70 | + app.UseBrowserLink(); |
| 71 | + app.UseDeveloperExceptionPage(); |
| 72 | + } |
| 73 | + else |
| 74 | + { |
| 75 | + app.UseExceptionHandler("/Home/Error"); |
| 76 | + } |
| 77 | +
|
| 78 | + app.UseStaticFiles(); |
| 79 | +
|
| 80 | + app.UseMvc(routes => |
| 81 | + { |
| 82 | + // Configure CQRS routes (optional) |
| 83 | + routes.ConfigureCQRS(); |
| 84 | + routes.MapRoute( |
| 85 | + name: "default", |
| 86 | + template: "{controller=Home}/{action=Index}/{id?}"); |
| 87 | + }); |
| 88 | +
|
| 89 | + // Configuring Incoding Framework IoC |
| 90 | + IoCFactory.Instance.Initialize(init => init.WithProvider(new MSDependencyInjectionIoCProvider(app.ApplicationServices))); |
| 91 | + |
| 92 | + // Configuring Incoding Framework caching |
| 93 | + CachingFactory.Instance.Initialize(init => init.WithProvider(new NetCachedProvider(() => app.ApplicationServices.GetRequiredService<IMemoryCache>()))); |
| 94 | +
|
| 95 | + BackgroundTaskFactory.Instance.AddScheduler(); |
| 96 | + |
| 97 | + // Configure some background services |
| 98 | + /* |
| 99 | + BackgroundTaskFactory.Instance.AddExecutor("SomeService", |
| 100 | + () => |
| 101 | + { |
| 102 | + new DefaultDispatcher().Push(new BackgroundServiceCommand()); |
| 103 | + }, options => options.Interval = TimeSpan.FromSeconds(15)); |
| 104 | +
|
| 105 | + BackgroundTaskFactory.Instance.AddSequentalExecutor("Some Sequential Service", |
| 106 | + () => new SequentialTestQuery(), arg => new SequentialTestCommand() |
| 107 | + , options => options.Interval = TimeSpan.FromSeconds(15)); |
| 108 | + */ |
| 109 | + |
| 110 | + // Execute this after configuring all Tasks above (include Scheduler task) |
| 111 | + BackgroundTaskFactory.Instance.Initialize(); |
| 112 | +
|
| 113 | + // Don't forget to stop all tasks when application is shutting down |
| 114 | + applicationLifetime.ApplicationStopping.Register(() => |
| 115 | + { |
| 116 | + BackgroundTaskFactory.Instance.StopAll(); |
| 117 | + }); |
| 118 | + } |
| 119 | + } |
| 120 | +``` |
| 121 | + |
| 122 | +### Prerequisites |
| 123 | + |
| 124 | +* Incoding.Core |
| 125 | +* Incoding.Data -> Incoding.Data.* (providers) |
| 126 | +* Incoding.Web |
| 127 | +* Your web application |
| 128 | + |
| 129 | +OR |
| 130 | + |
| 131 | +* Incoding.Core |
| 132 | +* Incoding.Data -> Incoding.Data.* (providers) |
| 133 | +* Your desktop/other application |
| 134 | + |
| 135 | + |
| 136 | +### Testing |
| 137 | + |
| 138 | +Incoding.MSpec |
| 139 | + |
| 140 | +### Installing |
| 141 | + |
| 142 | +Web App: |
| 143 | +``` |
| 144 | +Nuget (including all dependencies): Incoding.Web |
| 145 | +Nuget (EF provider): Incoding.Data.EF |
| 146 | +``` |
| 147 | + |
| 148 | +Domain Library: |
| 149 | +``` |
| 150 | +Nuget (including all dependencies): Incoding.Data |
| 151 | +Nuget (EF provider): Incoding.Data.EF |
| 152 | +``` |
| 153 | + |
| 154 | +### Usage Example |
| 155 | +``` |
| 156 | +Coming soon |
| 157 | +``` |
| 158 | + |
| 159 | +## Versioning |
| 160 | + |
| 161 | +For the versions available, see the [tags on this repository](https://github.com/Incoding-Software/Incoding-Framework-Core/tags). |
| 162 | + |
| 163 | +## Authors |
| 164 | + |
| 165 | +* **Vlad Kopachinsky** - *Original version* - [Incoding Framework](https://github.com/Incoding-Software/Incoding-Framework) |
| 166 | + |
| 167 | +* **Victor Gelmutdinov** - *.NET Core migration work* |
| 168 | + |
| 169 | +## License |
| 170 | + |
| 171 | +This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details |
| 172 | + |
0 commit comments