mardi 25 juillet 2017

Where to put the business logic for updating tables?

Where would I put the CreateOrder() business logic?

class Order // this is an entity model for DbContext
{
    public int Id { set; get; }
    public String name { set; get; }
    .......
}

public void CreateOrder(Details details)
{
    // set up Order fields
    .........
    database_name.Order.Add(order);
}

 controller would call obj.CreateOrder(details);

Would it go in a different class in the App_Code folder? Thank you.

Aucun commentaire:

Enregistrer un commentaire