public static StrategyModel ToModel(this StrategyEntity SE) { if (SE != null) { BossesPerZoneRepository repoBZ = new BossesPerZoneRepository(); CharactersConfigurationRepository repoCC = new CharactersConfigurationRepository(); UserRepository repoU = new UserRepository(); StrategyModel SM = new StrategyModel(); SM.User = repoU.GetOne(SE.UserId).MapTo <UserModel>(); SM.CharactersConfiguration = repoCC.GetOne(SE.CharactersConfigurationId).ToModel(); SM.BossZone = repoBZ.GetOne(SE.BossZoneId).ToModel(); SM.ImagePath1 = SE.ImagePath1; SM.ImagePath2 = SE.ImagePath2; SM.ImagePath3 = SE.ImagePath3; SM.ImagePath4 = SE.ImagePath4; SM.Description = SE.Description; SM.Note = SE.Note; SM.Id = SE.Id; SM.Active = SE.Active; return(SM); } else { return(null); } }