Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LightSwitch: How do I place my business logic into a separate assembly?

I have no idea how to do this simple task. LightSwitch's Solution Explorer is different in the sense that it doesn't allow to add other projects such as Class Library. Even if I could add a Class Library I would still need to reference the data model from it. As the data model is inside the LightSwitch project I would have a circular reference.

I didn't like this architecture of LightSwitch. I think the data model generated by the designer should be placed in a separate assembly. I also think the Solution Explorer should allow multiple projects so that I could create a business logic assembly, reference the data model and reference the business logic assembly from the LightSwitch project.

As the world is not the way I think it should be, how do I do this?

like image 806
André Pena Avatar asked Dec 28 '22 08:12

André Pena


1 Answers

In the Soulution Explorer there is a drop-down on the top to switch from Logical View (what you initially see) to File View (this will show the project/file structure.) Once you have done that you can add assembly references as appropriate. After you have done that switch back to the Logical View and then add your own validation logic to entities/fields/etc.

like image 91
Brett Forsgren - MSFT Avatar answered Jan 24 '23 14:01

Brett Forsgren - MSFT