Created
July 31, 2015 12:58
-
-
Save demofan/3e7185c3c44bad5fa75a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void Update(Article data) | |
{ | |
var oldData = GetSingleData(data.Id); | |
if (oldData != null) | |
{ | |
Mapper.CreateMap<Article, Article>() | |
.ForMember(d => d.CreateTime, d => d.Ignore()) | |
.ForMember(d => d.LastEditTime, d => d.UseValue(DateTime.UtcNow)); | |
// oldData.Subject = data.Subject; | |
oldData = Mapper.Map<Article>(data); | |
Save(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment