public virtual void RemoveCustomerInfo(UserCustomerInfo customerInfo) { if (CustomerInfo.Contains <UserCustomerInfo>(customerInfo)) { var foundInfo = CustomerInfo.Single(ci => ci == customerInfo); CustomerInfo.Remove(foundInfo); } }
public virtual void AddCustomerInfo(UserCustomerInfo customerInfo) { //Update existing info item if (CustomerInfo.Contains <UserCustomerInfo>(customerInfo)) { var foundInfo = CustomerInfo.Single(ci => ci.Equals(customerInfo)); foundInfo.PricePrHour = customerInfo.PricePrHour; } else { CustomerInfo.Add(customerInfo); } }