示例#1
0
        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            base.OnModelCreating(modelBuilder);
            modelBuilder.HasDbFunction(() => ServerFunctions.GeoDistanceMiles(0, 0, 0, 0));

            OnModelCreatingCallback?.Invoke(modelBuilder);
        }
示例#2
0
 internal WSRoleSet(WSDBSet core_sources, ServerFunctions _Func)
 {
     Func = _Func;
     foreach (byte role in WSConstants.USER_ROLE.ROLES)
     {
         if (!Keys.Any(x => x == role))
         {
             WSDBSet sources = new WSDBSet(role);
             foreach (string db in core_sources.Keys)
             {
                 IEnumerable <WSTableSource> role_sources = core_sources[db].Where(x => x.AccessLevel <= role);
                 if (role_sources.Any())
                 {
                     sources.Add(db, new WSSources <WSTableSource>(role_sources.Select(src => src.Clone(_Func, role))));
                 }
             }
             Add(role, sources);
         }
     }
 }