Пример #1
0
        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();
            }
        }
Пример #2
0
 public ProfileRepository(MSMContext dbContext)
     : base(dbContext)
 {
 }
Пример #3
0
 public ActorsController(MSMContext context)
 {
     _context = context;
 }
Пример #4
0
 public UserRepository(MSMContext context)
     : base(context)
 {
 }
Пример #5
0
 public UnitOfWork(MSMContext dbContext)
 {
     _dbContext = dbContext;
 }
 public MessageGroupProfileRepository(MSMContext context)
     : base(context)
 {
 }
Пример #7
0
 public MessageRepository(MSMContext context)
     : base(context)
 {
 }
Пример #8
0
 public LastGeoRepository(MSMContext context)
     : base(context)
 {
 }
 public MoviesController(MSMContext context)
 {
     _context = context;
 }
 public GeolocationHistoryRepository(MSMContext context)
     : base(context)
 {
 }
Пример #11
0
 public MeetingRepository(MSMContext context)
     : base(context)
 {
 }
 public NotificationRepository(MSMContext context)
     : base(context)
 {
 }
Пример #13
0
 public PostRepository(MSMContext context)
     : base(context)
 {
 }
Пример #14
0
 public FriendRepository(MSMContext context)
     : base(context)
 {
 }
Пример #15
0
 public ProducersController(MSMContext context)
 {
     _context = context;
 }
Пример #16
0
 public BaseRepository(MSMContext context)
 {
     DbSet      = context.Set <TEntity>();
     _dbContext = context;
 }