public Base(Databases.Mongo client, string Name = "") { Client = client ?? throw new Exception("Injected Database mustn't be null"); MigrationFolder = "UploadedData"; CollectionName = Name ?? TypeName; MigrateData(); }
public BaseController(IOptionsSnapshot <Configs.Mongo> options, IOptionsSnapshot <Configs.JWT> secret, IHttpContextAccessor httpContextAccessor) { Options = options; Sekrit = secret; Context = httpContextAccessor; Token = null; MongoClient = new Databases.Mongo(Options); TokenRepo = new Repositories.Mongo.Token(MongoClient); var Headers = Context.HttpContext.Request.Headers; var Authorized = Headers.Where(x => x.Key == "Authorization").Select(x => x.Value).FirstOrDefault(); Authorization = (string.IsNullOrEmpty(Authorized)) ? "" : ((string)Authorized).Substring(7); }
public Promotion(Databases.Mongo client) : base(client, "Promotions") { }
public SubCategory(Databases.Mongo Client) : base(Client, "SubCategories") { }
public Order(Databases.Mongo client) : base(client, "Orders") { }
public Token(Databases.Mongo Client) : base(Client, "Tokens") { }
public User(Databases.Mongo client) : base(client, "Users") { }
public Product(Databases.Mongo client) : base(client, "Products") { }
public Recommendation(Databases.Mongo client) : base(client, "Recommendations") { }
public Resource(Databases.Mongo Client) : base(Client, "Resources") { }