public static async Task<Benefits> UpdateCosts(BenefitsCost benefitsCost) { using (var context = new DbModel<Benefits>()) { var benef = context.First(); benef.Cost.Employee = benefitsCost.Employee; benef.Cost.Dependent = benefitsCost.Dependent; benef.Cost.Description = benefitsCost.Description; return await context.Update(benef); } }
/// <summary> /// Get the yearly cost of benefits /// </summary> /// <param name="bypassCache">Option to bypass the cache (default = false)</param> /// <returns>Returns the yearly cost of benefits for employees and dependents</returns> public BenefitsCost Get(bool bypassCache = false) { var response = new BenefitsCost(); try { response = Data.Costs(bypassCache); } catch (Exception e) { logger.Error(e); } return response; }