public UserModel GetUser(int userId) { UserModel model = new UserModel(); User user = session.Load<User>(userId); return model.FilledBy(user); }
public static void FilledBy(this IList<UserModel> model, IList<User> users) { foreach (User user in users) { UserModel item = new UserModel(); item.FilledBy(user); model.Add(item); } }
public static void FilledBy(this AuthorizationModel model, Authorization authorization) { model.Id = authorization.Id; model.CanAdmin = authorization.IsAdmin; model.CanOwn = authorization.IsOwner; model.CanPublish = authorization.IsPublisher; UserModel user = new UserModel(); user.FilledBy(authorization.User); model.User = user; }
public static TaskHistoryItemModel FilledBy(this TaskHistoryItemModel model, HistoryItem item) { model.CreateTime = item.CreateTime; UserModel executor = new UserModel(); executor.FilledBy(item.Executor); model.Executor = executor; model.Comment = item.Comment; model.Description = item.Description; return model; }