public bool AddMember(Entity.Member member) { try { using (var db = new CBHSDBContext()) { db.Members.Add(_mapper.Map <Entity.Member, Datasource.Member>(member)); db.SaveChanges(); } return(true); } catch (Exception ex) { //Log the exception return(false); } }
public static bool AddMember(Member member) { //member.MemberId = members.Count() + 1; try { //members.Add(member); using (var db = new CBHSDBContext()) { db.Members.Add(member); db.SaveChanges(); } return(true); } catch (Exception ex) { //Log the exception return(false); } }