I am little bit confused about whether I can put all below functions to one class or if I should split into more classes.
I think GetCustomerByID
and AddCustomerData
got different responsibilites but on the other hand I think it's the same responsibility. Please help me by clearing the concept what is SRP in following code.
public class CustomerHelper
{
NorthwindEntities db = new NorthwindEntities();
public List<Customer> GetAllCustomers()
{
return db.Customers.ToList();
}
public Customer GetCustomerByID(string customerid)
{
return db.Customers.Find(customerid);
}
public int AddCustomerData(Customer customer)
{
db.Customers.InsertOnSubmit(customer);
db.SubmitChanges();
return customer.CustID;
}
}