public static Map ToMap(Maps dbMap) { return new Map { Id = dbMap.Id, Name = dbMap.Name }; }
public static Map CreateMap(MapsEntities entities, string mapName) { var newMap = new Maps { Name = mapName, CreationTime = DateTime.Now }; Maps insertedMap = entities.Maps.Add(newMap); entities.SaveChanges(); StudMapCache.Global.UpdateMaps(entities); return Conversions.ToMap(insertedMap); }