public static void Seed(MSMContext context) { if (!context.GeolocationHistory.Any()) { var user = context.Users.FirstOrDefault(x => x.UserName == "123@123"); var profile = context.Profiles.FirstOrDefault(x => x.Id == user.ProfileId); var idx = 0; foreach (var geolocation in Geolocations) { context.GeolocationHistory.Add(new GeolocationHistory { Profile = profile, Latitude = geolocation.Latitude, Longitude = geolocation.Longitude, Time = DateTime.Now.AddMinutes(-idx), }); } context.SaveChanges(); } }
public ProfileRepository(MSMContext dbContext) : base(dbContext) { }
public ActorsController(MSMContext context) { _context = context; }
public UserRepository(MSMContext context) : base(context) { }
public UnitOfWork(MSMContext dbContext) { _dbContext = dbContext; }
public MessageGroupProfileRepository(MSMContext context) : base(context) { }
public MessageRepository(MSMContext context) : base(context) { }
public LastGeoRepository(MSMContext context) : base(context) { }
public MoviesController(MSMContext context) { _context = context; }
public GeolocationHistoryRepository(MSMContext context) : base(context) { }
public MeetingRepository(MSMContext context) : base(context) { }
public NotificationRepository(MSMContext context) : base(context) { }
public PostRepository(MSMContext context) : base(context) { }
public FriendRepository(MSMContext context) : base(context) { }
public ProducersController(MSMContext context) { _context = context; }
public BaseRepository(MSMContext context) { DbSet = context.Set <TEntity>(); _dbContext = context; }