public void Insert(ShareLogInfo entity) { if (entity == null) { throw new ArgumentNullException(nameof(entity)); } using (var db = new BaseDatabaseContext()) { db.ShareLogInfos.Add(entity); db.SaveChanges(); } }
public static ShareLogInfoModel ToModel(this ShareLogInfo entity) { return(entity.MapTo <ShareLogInfo, ShareLogInfoModel>()); }
public static ShareLogInfo ToEntity(this ShareLogInfoModel model, ShareLogInfo destination) { return(model.MapTo(destination)); }