private PostHistoryDTO ToDTO(PostHistoryEntity postHistoryEntity) { PostHistoryDTO postHistoryDTO = new PostHistoryDTO() { ApproveStateId = postHistoryEntity.ApproveStateId, Bank = postHistoryEntity.Bank, Id = postHistoryEntity.Id, Money = postHistoryEntity.Money, PostDesc = postHistoryEntity.PostDesc, UserId = postHistoryEntity.UserId }; return(postHistoryDTO); }
public long InsertPostHistory(PostHistoryDTO t_PostHistory) { using (B2CDbContext ctx = new B2CDbContext()) { PostHistoryEntity postHistoryEntity = new PostHistoryEntity() { ApproveStateId = t_PostHistory.ApproveStateId, Bank = t_PostHistory.Bank, Money = t_PostHistory.Money, PostDesc = t_PostHistory.PostDesc, UserId = t_PostHistory.UserId }; ctx.PostHistories.Add(postHistoryEntity); ctx.SaveChanges(); return(postHistoryEntity.Id); } }