/// <summary> /// Cascade set UserSearchModel Result /// </summary> /// <param name="user"></param> /// <returns></returns> public static UserSearchModel SetUserSearchModelCascade(ApplicationUser user) { if (user == null) { return(null); } var userSearchModel = new UserSearchModel { UserId = user.Id, UserName = user.UserName, Groups = user.UserGroups.Select(v => GroupOperator.SetGroupSubSearchModel(v.Group)), Locations = user.UserLocations.Select(v => LocationOperator.SetLocationSubSearchModel(v.Location)) }; return(userSearchModel); }
/// <summary> /// Cascade set AlarmSearchModel Result /// </summary> /// <param name="alarm"></param> /// <returns></returns> public static AlarmSearchModel SetAlarmSearchModelCascade(Alarm alarm) { if (alarm == null) { return(null); } var alarmSearchModel = new AlarmSearchModel { AlarmId = alarm.AlarmId, AlarmMessageId = alarm.AlarmMessageId, LocationId = alarm.LocationId, CreateDate = alarm.CreateDate, Location = LocationOperator.SetLocationSubSearchModel(alarm.Location), AlarmMessage = AlarmMessageOperator.SetAlarmMessageSubSearchModel(alarm.AlarmMessage) }; return(alarmSearchModel); }
/// <summary> /// Cascade set LogSearchModel Result /// </summary> /// <param name="log"></param> /// <returns></returns> public static LogSearchModel SetLogSearchModelCascade(Log log) { if (log == null) { return(null); } var logSearchModel = new LogSearchModel { LogId = log.LogId, Comment = log.Comment, LogDescriptionId = log.LogDescriptionId, LocationId = log.LocationId, Creator = log.Creator, CreateDate = log.CreateDate, Modifier = log.Modifier, ModifiedDate = log.ModifiedDate, LogDescription = LogDescriptionOperator.SetLogDescriptionSubSearchModel(log.LogDescription), Location = LocationOperator.SetLocationSubSearchModel(log.Location) }; return(logSearchModel); }