LASG + MVC 5 + EF 6 + Designers

Mar 30, 2016 at 10:55 AM
Hi!

I have been experimenting with the Layered Architecture Solution Guidance (LASG) for sometime now. I'm using Visual Studio 2015. I started with your blog (at http://serena-yeoh.blogspot.ae/2013/06/layered-architecture-for-net.html) and followed the sample there. I was able to access the special right click menus for adding Entities, Components, and Services using the cool designers.

I hit a blockade after adding a Service because the generated code was attempting to use a "Fault" type object that is no where to be found:
namespace DA.Services.CarPark.Services.Contracts
{
    /// <summary>
    /// FaultHandler class.
    /// </summary>
    public class FaultHandler : IErrorHandler
    {
        public bool HandleError(Exception error)
        {
            return true;
        }

        public void ProvideFault(Exception error, MessageVersion version, ref Message fault)
        {
            string reason = "An unhandled exception has occurred in the service.";

            Fault faultContract = new Fault(error.Message);

            var faultEx = new FaultException<Fault>(faultContract, reason);

            MessageFault messageFault = faultEx.CreateMessageFault();
            fault = Message.CreateMessage(version, messageFault, faultEx.Action);
        }
    }
}
Image

So my progress stopped there. Then I went on to the newer LeaveSample with MVC and EF. It is working perfectly. However, i see that the right-click menus and designers are not available there. Also, there is no step by step tutorial describing how the application was finalized. The Guidance project that generates the template doesn't go for EF by default when I use the designer for Components.

Any plans to upgrade to support new standards or a tutorial for "LASG + MVC 5 + EF 6 + Designers"?

Also, with MVC6 and EF7 just around the corner...
Coordinator
Aug 4, 2016 at 11:48 PM
Hi,

If you select to "Generate fault handler" and you don't already have a FaultContract generated, you can select "Generate fault contract" and enter a name to generate one, or you can hand-code one yourself. If you do not want to implement FaultContracts, you can just ignore the Fault handlers (delete it if you accidentally generated it).

The LeaveSamples are not 100% code-generated. Their initial base code is generated using LASG but then they are hand-coded to fit in the technologies they represent. LASG do not support MVC and EF. There will be no plans to support MVC or EF code generation because EF itself already provides a lot of scaffolding capabilities. You can easily swap out the whole DAC with one that you use EF to create.

I am sorry to disappoint you on the MVC and EF part.

Best Regards.