Subscribe: Architecture
http://forums.asp.net/rss.aspx?ForumID=16&Mode=0
Preview: Architecture

Architecture



Discuss and debate ASP.NET application designs.



Last Build Date: Wed, 03 May 2017 01:13:00 -0700

 



How to inhert from multiple place..I know .net wont support multiple inheritace...but is there any way around

2017-05-24T17:13:10.557-07:00

Lets say I have below class

public class CallMe

{

public int PhoneNumber {get;set;}

}

public class MailMe

{

public string Email {get;set;}

}

Now

I want to create a class with has all the properites of Callme and MailMe

like

public class Communicate :Callme,MailMe

{

public string Name {get;set;}

}

I dont want CallMe and MailMe as property for Communicate...

How to do this




Clarity on separation of code in MVC

2017-05-19T13:40:26.95-07:00

Have a question that is in regard to where things should go for the term 'best practice'.

The project is all form creation with different instances being routed to that person own area within their department.

Currently there is the AccountController and the SAMLController for the login/SSO

FormsController that has the first form that has been created so far with post and get methods and also about 10 or more Jsonresult action methods that will be used with the other additional forms that will be added. 

Questions about the FormsController/Controllers

Should the Jsonresult action methods be in their own controller?

The forms that will be created are under category like General, Engineering, IT and HR.   There should be a controller for each form category HRController ? 

Questions about the LINQ TO SQL in the controller

Should the LINQ TO SQL be taken out of the FormControllers ...each form will be in different table so I think the post and get are  good to stay in there Category controller would whomever agree?

Thank you, SB




Migrating from .NET 4.0 to 4.5

2017-05-19T05:08:21.027-07:00

I have an ASP.NET application, which is using .NET framework 4.0 in Visual Studio 2010. Now I want to migrate it 4.5 in Visual Studio 2012. When I opened the entire solution in VS2012, the whole project migrated successfully along with the option of the backup.  But when I cleaned and rebuild the whole solution, I came across these errors. How can I resolve these errors? Error 1 The call is ambiguous between the following methods or properties: 'ProjectName.SBST.InitClass()' and 'ProjectName.SBST.InitClass()' C:\Users\pc\Desktop\ExpProj\ProjectName\SBST1.Designer.cs 35 Error 2 The call is ambiguous between the following methods or properties: 'ProjectName.SBST.SchemaChanged(object, System.ComponentModel.CollectionChangeEventArgs)' and 'ProjectName.SBST.SchemaChanged(object, System.ComponentModel.CollectionChangeEventArgs)' C:\Users\pc\Desktop\ExpProj\ProjectName\SBST1.Designer.cs 36 Error 3 The call is ambiguous between the following methods or properties: 'ProjectName.SBST.InitVars(bool)' and 'ProjectName.SBST.InitVars(bool)' C:\Users\pc\Desktop\ExpProj\ProjectName\SBST1.Designer.cs 47 Error 4 The call is ambiguous between the following methods or properties: 'ProjectName.SBST.SchemaChanged(object, System.ComponentModel.CollectionChangeEventArgs)' and 'ProjectName.SBST.SchemaChanged(object, System.ComponentModel.CollectionChangeEventArgs)' C:\Users\pc\Desktop\ExpProj\ProjectName\SBST1.Designer.cs 48 Error 5 Ambiguity between 'ProjectName.SBST.Tables' and 'ProjectName.SBST.Tables' C:\Users\pc\Desktop\ExpProj\ProjectName\SBST1.Designer.cs 49 Error 6 Ambiguity between 'ProjectName.SBST.Relations' and 'ProjectName.SBST.Relations' C:\Users\pc\Desktop\ExpProj\ProjectName\SBST1.Designer.cs 50 Error 7 The call is ambiguous between the following methods or properties: 'ProjectName.SBST.SBSTDataTable.SBSTDataTable(System.Data.DataTable)' and 'ProjectName.SBST.SBSTDataTable.SBSTDataTable(System.Data.DataTable)' C:\Users\pc\Desktop\ExpProj\ProjectName\SBST1.Designer.cs 58 Error 8 The call is ambiguous between the following methods or properties: 'ProjectName.SBST.InitVars()' and 'ProjectName.SBST.InitVars()' C:\Users\pc\Desktop\ExpProj\ProjectName\SBST1.Designer.cs 67 Error 9 The call is ambiguous between the following methods or properties: 'ProjectName.SBST.SchemaChanged(object, System.ComponentModel.CollectionChangeEventArgs)' and 'ProjectName.SBST.SchemaChanged(object, System.ComponentModel.CollectionChangeEventArgs)' C:\Users\pc\Desktop\ExpProj\ProjectName\SBST1.Designer.cs 73 Error 10 Ambiguity between 'ProjectName.SBST.Relations' and 'ProjectName.SBST.Relations' C:\Users\pc\Desktop\ExpProj\ProjectName\SBST1.Designer.cs 75 Error 11 Ambiguity between 'ProjectName.SBST.tableSBST' and 'ProjectName.SBST.tableSBST' C:\Users\pc\Desktop\ExpProj\ProjectName\SBST1.Designer.cs 84 Error 12 Ambiguity between 'ProjectName.SBST._schemaSerializationMode' and 'ProjectName.SBST._schemaSerializationMode' C:\Users\pc\Desktop\ExpProj\ProjectName\SBST1.Designer.cs 94 Error 13 Ambiguity between 'ProjectName.SBST._schemaSerializationMode' and 'ProjectName.SBST._schemaSerializationMode' C:\Users\pc\Desktop\ExpProj\ProjectName\SBST1.Designer.cs 97 Error 14 The call is ambiguous between the following methods or properties: 'ProjectName.SBST.InitClass()' and 'ProjectName.SBST.InitClass()' C:\Users\pc\Desktop\ExpProj\ProjectName\SBST1.Designer.cs 123 Error 15 The call is ambiguous between the following methods or properties: 'ProjectName.SBST.InitVars()' and 'ProjectName.SBST.InitVars()' C:\Users\pc\Desktop\ExpProj\ProjectName\SBST1.Designer.cs 131 Error 16 The call is ambiguous between the following methods or properties: 'ProjectName.SBST.SBSTDataTable.SBSTDataTable(System.Data.DataTable)' and 'ProjectName.SBST.SBSTDataTable.SBSTDataTable(System.Data.DataTable)' C:\Users\pc\Desktop\ExpProj\ProjectName\SBST1.Designer.cs 156 Error 17 The call is ambiguous between the following methods or properties: 'ProjectName.SBST.InitVars()' and 'ProjectName.SBST.InitVars()' C:\Users\pc\Desktop\ExpProj\Pr[...]



Patterns in mvc

2017-05-15T13:33:51.537-07:00

Could someone suggest the best way to break up, aside from MVC doing this already , the data LINQ TO SQL queries to return results to the controller. 




Xamarin mobile app and ASP.Net Core backend architecture

2017-05-12T14:28:15.867-07:00

Hello, 

 I was approached by a customer who wants to develop a mobile app for iOS and Android.

The goal of the app is to allow the localization of commercial partners offering services. Each provider must describe the proposed services (photos, description, prices) and may also offer promotions. The end user will be able to consult the list of providers and it's services, book a service and then rate the provider.

In a first time, the customer would like a first version that is close to a POC: the app must be stable and include all the expected features.

As my customer knows Xamarin, and as I have already used it on small projects, I think that Xamarin.Forms is a good choice for the first version of this app.

But for backend, it's not as clear for my customer: he does not really know what he needs...

I have identified 3 needs:

  • the APIs that will be used by the mobile app
  • a "backoffice" that will be used by my customer's company, to manage the providers
  • a "middleoffice" that will be used by the providers, to manage their offers, and receive the users bookings

My client would have a preference for a Symfony / Angular architecture, as he has already used this on other projects. For my part, I would rather use a full .Net architecture: Xamarin + ASP.Net Core + Azure.

What do you think? Are there any plugins or frameworks that I could use for such a project? (like Serinity)




Choosing between MVC 5 and .NET Core for new project

2017-05-12T06:40:21.83-07:00

I have been assigned to work on a new and large project. I am well versed with MVC 5 with other projects. I am trying to make a decision to choose between MVC5 or .NET Core for development. Given that I have a strict time constraint plus have to go through a learning curve with .NET Core, which route should I take.

Thanks in advance.




Blend Umbraco (or other CMS) with custom MVC site

2017-05-11T12:24:47.917-07:00

We have built an extensive custom MVC ecommerce site with all the usual aspects you'd expect - categories, products, basket checkout etc.

Within the site we want to create a whole range of informational content and ideally are looking at using a CMS to do this so non tech users can author the content. On the site though this content needs to be accessible from within our current design / navigation so the site looks consistent throughout.

We have some experience of Umbraco as a stand alone CMS / site.

I've had a bit of a google around but can't really find anything about integrating so closely (although I am probably not looking for the right thing) - where do we start? Anyone else done the same sort of thing or know of any decent tutorials, or are we best to roll our own CMS for this purpose?

Thanks.




IIS app hosting under 4.6 can you avoid Kestrel?

2017-03-31T13:56:53.007-07:00

So Im getting my arms around all the changes with .NET core and one thing that struck me is the new architecture dealing with app pools.  

After reading these two articles, Im wondering if we are being forced down this path of having our app code hosted in Kestrel and dealing with the IIS-Kestrel interactions?

https://weblog.west-wind.com/posts/2016/Jun/06/Publishing-and-Running-ASPNET-Core-Applications-with-IIS
https://weblog.west-wind.com/posts/2017/Mar/16/More-on-ASPNET-Core-Running-under-IIS

For the most part, our team will never need to host on anything other than Windows and will often need enough other libraries / services etc such as Windows Workflow, that the full framework is needed.  

Question:
Can I target the newer framework with an MVC application and still host my app with an application pool targeting the latest framework, and simply avoid Kestrel?  

Our team is perfectly happy with MVC5  and the 4.5x framework configured App pools.  Can we target 4.6x and avoid Kestrel ?  




ASP.NET Core API/MVC solution architecture for Real-World application

2017-04-19T19:48:33.027-07:00

I know architecture questions are mostly opinion based, but I would appreciate it if you guys can glance over the structure of my project and let me know any downsides.


TestProject.Api
The web api for the application. This application references all 3 class libraries (Core, Business, Data). The StartUp.cs file will specify the TestProjectDbContext and also configure dependency injection services: ICustomerRepository, CustomerRepository - ICustomerManager, CustomerManager. This is so we can inject these into the Api controllers at run time.

TestProject.Core
This class library contains no references. It contains the Domain Models, i.e. Customer.cs. Additionally, all of the interfaces for the Repositories (Data) and Manager (Business) classes, i.e. ICustomerManager, ICustomerRepository.

TestProject.Business
This class library contains a bunch of classes with the suffix Manager. For example CustomerManager. The plan is to have this project never call the Data layer or know anything about it. Each one of the classes in here will contain all of the complex business logic. The plan is for the Api to make calls to the repository to get the params needed to call the business functions. For example, _orderRepository.GetOrderById(id), then call _orderManager.CalculateOrderTotal(order). This class library will only reference the Core project so it knows about the Domain Models and can implement the Interfaces.

TestProject.Data
This class library will have entity framework installed and will contain TestProjDbContext and a folder with all of the repositories. For example: CustomerRepository, OrderRepository, etc... It will also contain the ef Migrations folder. This class library will only reference the Core project so it knows about the Domain Models and can implement the Interfaces.

Here is a different view of it:

TestProj.Business
     CustomerManager.cs
TestProj.Core
     -Interfaces
          -Business
               ICustomerManager.cs
          -Data
               -Repositores
                    ICustomerRepository.cs
          -Models
               Customer.cs
TestProj.Data
     ArchProjDbContext.cs
     -Migrations
     -Repositories
          CustomerRepository.cs

I would like some thoughts/opinions on this architecture. The goal here is to make it so Testing will be easy and if another application were to try and hook into this it will be easy. I believe there is a benefit to having all of the Interfaces and Models in the Core project rather than the Business interfaces in the business layer and the Repository interfaces in the data layer.




develop angular app with VS2015

2017-04-18T04:34:58.893-07:00

Hi

i am very new to angular, currently i am using angular cli , i want to use VS2015 to develop angular project, how can i create angular apps with VS2015




Anyone familiar with Code Kata?

2017-04-24T17:30:38.697-07:00

Hello, I"m trying to learn domain modeling. I wanted to know where i can get some practice. Are there any communities? Or places i can do. How do the Katas work? I've found a page here or there but it doesn't seem very well organized.

Any suggestions on what i could do? Thanks!




Security on Angular/WebApi with OAuth backend services

2017-03-27T10:27:58.593-07:00

Deleted..




How to segment an existing WebForms application

2017-04-03T11:24:28.25-07:00

Hello,

I have a WebForms application running ASP.NET 4.5 on IIS 10, everything is set up as a single IIS website. The application consists of three "parts" that unforutnately were designed as a monolithic project (one application, i.e. one main dll with some class libraries). The challenge now is I'd like to migrate to some new, cool technologies like MVC, node, React.JS, maybe with ASP.NET Core. However the problem is that I don't want to write entire application from scratch, it would take too much time. I'd like to do this partially, one part (app section) at a time. IIS doesn't allow to put a new application inside an already existing application. Also if I used ASP.NET Core, I can't run it with a website that also hosts WebForms application.

It seems to me that the only solution is moving part of the application to a subdomain (and thus a separate website in IIS) or using reverse proxy (e.g. Application Request Routing in IIS) which looks rather ugly in terms of design and overhead but would allow to preserve URLs "inside" the old Web Forms app. Maybe there are some other solutions? What do you think would be the best approach here?

Once again, the goal is to be able to "upgrade" part of Web Forms application to something more fancy than Web Forms, and to avoid having to move it to a separate subdomain. Can .NET apps coexist in any way in this setup?

Many thanks for all your insights!




Difference between class method and static method, when to use which?

2017-03-31T09:51:05.577-07:00

What is the main difference between class method and class static method, does it have impact on performance when to use it?




layred application mvc sales order and linq to entity

2017-03-11T15:02:31.903-08:00

hello

i'm beginner in repository and layerd application. and  i don't inderstand well which is the interaction and the relationship between the repositories and business layer classes.

 I have a confusion between both them

Here is an example for purchaese order in 3 layers and I want to review whether correct or not, and your correction

for DataAcesslayer

repository OrderRepositolry

Namespece Dal
    {
       Public class RepositoryOrder
       {
              POrderContext context = new POrderContext ();
 
              Public IEnumrebale  GetAll ()
              {
                   Context.Orders;
              }
// Following code
       }
    }

for the item of order repositories code :

namespece Dal
{
      public class RepositoryOrderItem
      {
             POrderContext context = new POrderContext();

             public IEnumrebale GetAllItemById(Order o)
             {
                  context.OrderItems.where(i => i.OrderId == o.Id);
             }

            public OrderItem GetItemById(int id)
            {
                 context.OrderItems.Find(id);
            }
//Following code
      }
}

for businessLayer here is classOrderBLL code:

namespace BLL
{
      public class OrderBLL
      {
            RepositoryOrder repoOrder = new RepositoryOrder();
            RepositoryOrderItem repoItem = new  RepositoryOrderItem();

            public IList GetAll()
           {
               return repoOrder.GetAll();
           }

            public decimal GetPrixTotal(Order order)
           {
                var query = from item in repoItem.GetAllItemById(order)
                                 select sum(item=>item.Prix * item.Quantite);
                return query;
            }
      }  
}
  1. does the total price calculation is done at the level of repository or at the level of BLL (we can make this request linq with context in the repository)?

  2. CRUD method is done at repository and they are called at BLL from repository is it right?

  3. The where extension method or the where clause in the linq to entity query matches the business rule (will be implemented at BLL) or corresponds to the read data acess (at the repository level).

Any help, advice and good practice will be welcome

have a good day




Best layer to handle exceptions, convertions and custom errors in three tire architecture in asp.net three tire application?

2017-03-21T06:23:03.7-07:00

My architecture design:

Front end(UI): Web-services, asp.net web-forms, jQuery.

BLL: Business logic.

DAL: Accessing database.

I have classes for each table in database.

Q1. I am using date format  that is different from database. Should I handle this in BLL or UI(Web-service or jQuery)?

Q2. I have unique key for my mail-id column. If user tries to insert/update I will check for unique. I not unique I want to say user to enter unique. Now I access DAL for unique from BLL and call DAL for update/insert according to result. Now should I handle this custom errors in BLL and send error message to jQuery in JSON string or in UI(Web-service or jQuery)?

Q3. When exceptions occurs I am just throwing and handling them in jQuery error section. Is this right or should I handle them in BLL and send error messages in form of JSON string to jQuery?

I consider doing all these stuff in BLL because it is where we will have all the converting logic's like readers into objects. Am I wrong?




sales order & linq to entity

2017-03-11T13:38:37.163-08:00

hello

i'm beginner in repository and layerd application. and  i don't inderstand well which is the interaction and the relationship between the repositories and business layer classes.

 I have a confusion between both them

Here is an example for purchaese order in 3 layers and I want to review whether correct or not, and your correction

for DataAcesslayer

repository OrderRepositolry

Namespece Dal
    {
       Public class RepositoryOrder
       {
              POrderContext context = new POrderContext ();
 
              Public IEnumrebale  GetAll ()
              {
                   Context.Orders;
              }
// Following code
       }
    }

for the item of order repositories code :

namespece Dal
{
      public class RepositoryOrderItem
      {
             POrderContext context = new POrderContext();

             public IEnumrebale GetAllItemById(Order o)
             {
                  context.OrderItems.where(i => i.OrderId == o.Id);
             }

            public OrderItem GetItemById(int id)
            {
                 context.OrderItems.Find(id);
            }
//Following code
      }
}

for businessLayer here is classOrderBLL code:

namespace BLL
{
      public class OrderBLL
      {
            RepositoryOrder repoOrder = new RepositoryOrder();
            RepositoryOrderItem repoItem = new  RepositoryOrderItem();

            public IList GetAll()
           {
               return repoOrder.GetAll();
           }

            public decimal GetPrixTotal(Order order)
           {
                var query = from item in repoItem.GetAllItemById(order)
                                 select sum(item=>item.Prix * item.Quantite);
                return query;
            }
      }  
}
  1. does the total price calculation is done at the level of repository or at the level of BLL (we can make this request linq with context in the repository)?

  2. CRUD method is done at repository and they are called at BLL from repository is it right?

  3. The where extension method or the where clause in the linq to entity query matches the business rule (will be implemented at BLL) or corresponds to the read data acess (at the repository level).

have a good day




Mulitenant with dependancy Injection and IOC + Unity.MVC5

2017-03-20T13:42:30.92-07:00

Hi,

 As per requirement we need to create single instance multiple database application using the same enterprise architecture.

We have following requirements.

1. We have single database architecture and followed the UOW architecture as mentioned in link https://www.codeproject.com/articles/990492/restful-day-sharp-enterprise-level-application
2. Create a client specific database which will have clients data only. Means One application will have multiple databases.
3. Need to manage client specific connection string with UOW architecture

Thanks in advance




MVC with Angular JS or ASP .Net

2016-12-23T05:28:53.717-08:00

Hi friends,

I need to implement a project in Angular JS 2.0 , there is no mention by the client to use classic ASP.Net or MVC.

My problem is I am new to Angular as well as MVC. I wanted to know if I can use Angular with classic ASP.Net  (this will be simpler for me)  or there are constraints in this design?

I also wanted to know, how useful / easy will it be to use MVC with angular by learning it. Project will kick off in January 1st week.




Need advice for .Net project solution architecture

2016-10-30T15:38:52.947-07:00

Hi All,

Looking for your valuable advice on solution architecture for my requirement.

I have a requirement to develop an application using c#.Net, ASP.Net and SQL Server. The application should develop using latest version of .Net which can easily brows able in desktop and download as APP in mobile and IPad.

Key features of application are,

1)          2 way chatting facility to users (May be third party tools, I will use)

2)          Able to send SMS to users (May be third party tools, I will use)

3)          Generating dashboards and reports. The reports should be able to export to excel

4)          Email Notifications to users

Here my question is,

1)          Which version of .net I need to use to develop the application with above features and can able to run on multiple platforms (Multiple devices)?

2)          Which tool I need to use to develop application like Visual Studio or Xamarin or any other free best tool, please advice.

3)          I don’t want develop, deploy or maintain source code in multiple locations based on client (Mobile, Desktop or IPad). I want to write code in one place and build, deploy in one location which can be work as APP, web application. Please advise here development and deployment methods need to follow.

Hope I have given you clear information to understand and respond. In case need any more information, please let me know.

Thanking in advance for your kind response.