How is the "White Label" for my ASP.Net MVC application?

I have a white labeled application that is installed on the servers of several clients. For any given installation, the differences will include content, stylesheets and graphics, as well as some actual code / business logic. I want my TFS- the server automatically created all variants of my application, what are my options for this? for example, should themes be used? What about #if conditional compilation flags.

PS The question is not how to configure the build server - I already did it.

+3
source share
2 answers

For business logic, I would abstract the differences in individual libraries, and then you can use the IoC / DI template or the provider template to solve the right business logic at runtime.

Regarding content, I would consider topics. Essentially, you could build an assembly server once each time, and then when you pack the code that you choose, which assemblies you need and use the appropriate configuration, and select the appropriate theme folder for the client at hand.

I do not like to use # directives in this case. If you think about it, your unit tests will need to be performed for each conditional case. If you remove the conventions and abstract the differences, your test tests can run immediately on all plug-in assemblies.

+3
source
  • / - HtmlHelper/UrlHelper, Html\Url.Content() , ( , /Content +/ContentCustomer1, 2,...).
  • , . - Order.Calculate() ,
    • OrderPartsForCustomer1.cs
    • OrderPartsForCustomer2.cs

public partial class Order
{
   public Money Calculate()
   {
   }
}

.cs #ifs.

, OrderPartsCommon.cs, /, .

-1

Source: https://habr.com/ru/post/1718486/


All Articles