Base solution for your next web application

Activities of "bbakermmc"

We use DBFirst with our multi tenant setup. Like I said you just need to make a 2nd context thats going to be your DBFirst models. We generate all the POCOs separately then we just add them to this new context. Everything then just "works" with the default aspnetzero repos etc.

Note: we do multi tenancy per db not 1 table for all tenants. So every DB has their own tables.

public class DMPContextFactory : IDesignTimeDbContextFactory<DMPContext>
    {
        public DMPContext CreateDbContext(string[] args)

        {
            var builder = new DbContextOptionsBuilder<DMPContext>();
            var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder());

            DMPContextConfigurer.Configure(builder, configuration.GetConnectionString(PlatformConsts.ConnectionStringName));
            
            return new DMPContext(builder.Options);
        }
    }

public static class DMPContextConfigurer
    {
        public static void Configure(DbContextOptionsBuilder<DMPContext> builder, string connectionString)
        {
            builder.UseSqlServer(connectionString, o => o.UseRowNumberForPaging());
        }

        public static void Configure(DbContextOptionsBuilder<DMPContext> builder, DbConnection connection)
        {
            builder.UseSqlServer(connection, o => o.UseRowNumberForPaging());
        }
    }

Configuration.Modules.AbpEfCore().AddDbContext<DMPContext>(options =>
                {
                    //DMPContextConfigurer.Configure(configuration.DbContextOptions, configuration.ConnectionString);

                    if (options.ExistingConnection != null)
                    {
                        DMPContextConfigurer.Configure(options.DbContextOptions, options.ExistingConnection);

                    }
                    else
                    {
                        DMPContextConfigurer.Configure(options.DbContextOptions, options.ConnectionString);
                    }

                });

public class DMPContext : AbpDbContext
    {
        public DMPContext(DbContextOptions<DMPContext> options)
            : base(options)
        {
        }

        public DbSet<RpilistenerQueue> RpilistenerQueue { get; set; }
        public DbSet<Brc> Brc { get; set; }
        public DbSet<Brcquestion> Brcquestion { get; set; }
        public DbSet<Brctype> Brctype { get; set; }
        public DbSet<Package> Package { get; set; }
        public DbSet<Question> Question { get; set; }
        public DbSet<Source> Source { get; set; }
        public DbSet<LookupValue> LookupValue { get; set; }
        public DbSet<Answer> Answer { get; set; }
        public DbSet<ImportTwilioMessageQueue> ImportTwilioMessageQueue { get; set; }
        public DbSet<Contact> Contact { get; set; }
        public DbSet<ContactEvent> ContactEvent { get; set; }
        public DbSet<ContactEventActivity> ContactEventActivity { get; set; }
        public DbSet<AddressUnavailableReason> AddressUnavailableReason { get; set; }
        public DbSet<Channel> Channel { get; set; }
        public DbSet<Direction> Direction { get; set; }
        public DbSet<Campaign> Campaign { get; set; }
        public DbSet<ContactAddress> ContactAddress { get; set; }
        public DbSet<ContactIdentifierType> ContactIdentifierType { get; set; }
        public DbSet<ContactAnalytics> ContactAnalytics { get; set; }
        public DbSet<ContactAttributeName> ContactAttributeName { get; set; }
        public DbSet<ContactAttributeValue> ContactAttributeValue { get; set; }
        public DbSet<ContactInfo> ContactInfo { get; set; }
        public DbSet<ContactvDbs> ContactvDbs { get; set; }
        public DbSet<ContactMailOptStatus> ContactMailOptStatus { get; set; }
        public DbSet<ContactPhoneOptStatus> ContactPhoneOptStatus { get; set; }
        public DbSet<ContactEmailOptStatus> ContactEmailOptStatus { get; set; }
        public DbSet<ContactTextOptStatus> ContactTextOptStatus { get; set; }
        public DbSet<ContactFaxOptStatus> ContactFaxOptStatus { get; set; }
        public DbSet<CompanyContact> CompanyContact { get; set; }
        public DbSet<CompanyIdentifierType> CompanyIdentifierType { get; set; }
        public DbSet<CompanyAnalytics> CompanyAnalytics { get; set; }
        public DbSet<CompanyAttributeName> CompanyAttributeName { get; set; }
        public DbSet<CompanyAttributeValue> CompanyAttributeValue { get; set; }
        public DbSet<CompanyvDbs> CompanyvDbs { get; set; }
        public DbSet<CompanyInfo> CompanyInfo { get; set; }
        public DbSet<QuestionResponse> QuestionResponse { get; set; }
        public DbSet<ContactAddressType> ContactAddressType { get; set; }
        public DbSet<ContactPhone> ContactPhone { get; set; }
        public DbSet<ContactEmail> ContactEmail { get; set; }
        public DbSet<ContactIdentifier> ContactIdentifier { get; set; }
        public DbSet<ContactNote> ContactNote { get; set; }
        public DbSet<CompanyAddress> CompanyAddress { get; set; }
        public DbSet<CompanyAddressType> CompanyAddressType { get; set; }
        public DbSet<CompanyPhone> CompanyPhone { get; set; }
        public DbSet<CompanyEmail> CompanyEmail { get; set; }
        public DbSet<CompanyIdentifier> CompanyIdentifier { get; set; }
        public DbSet<CompanyNote> CompanyNote { get; set; }
        public DbSet<Company> Company { get; set; }
        public DbSet<TextTarget> TextTarget { get; set; }
        public DbSet<Country> Country { get; set; }
        public DbSet<TextMessage> TextMessage { get; set; }
        public DbSet<TextMessageHistory> TextMessageHistory { get; set; }
        public DbSet<TextMessageQueue> TextMessageQueue { get; set; }

        public DbSet<DataAugmentationCompanyAddress> DataAugmentationCompanyAddress { get; set; }
        public DbSet<DataAugmentationCompanyEmail> DataAugmentationCompanyEmail { get; set; }
        public DbSet<DataAugmentationCompanyPhone> DataAugmentationCompanyPhone { get; set; }
        public DbSet<DataAugmentationContactAddress> DataAugmentationContactAddress { get; set; }
        public DbSet<DataAugmentationContactEmail> DataAugmentationContactEmail { get; set; }
        public DbSet<DataAugmentationContactPhone> DataAugmentationContactPhone { get; set; }
        public DbSet<DataAugmentationContact> DataAugmentationContact { get; set; }
        public DbSet<DataAugmentationCompany> DataAugmentationCompany { get; set; }
        public DbSet<DataAugmentationListQuestion> DataAugmentationListQuestion { get; set; }
        public DbSet<DataAugmentationQuestion> DataAugmentationQuestion { get; set; }
        public DbSet<DataAugmentationResponse> DataAugmentationResponse { get; set; }
        public DbSet<DataAugmentationList> DataAugmentationList { get; set; }
        public DbSet<DataAugmentationQueue> DataAugmentationQueue { get; set; }
    }

private readonly IRepository<CompanyAddress, int> _dmpCompanyAddressRepository;
        private readonly IRepository<CompanyContact, int> _dmpCompanyContactRepository;
        private readonly IRepository<CompanyEmail, int> _dmpCompanyEmailRepository;
        private readonly IRepository<CompanyPhone, int> _dmpCompanyPhoneRepository;

var newRec = new DataAugmentationCompanyPhone
            {
                CompanyPhoneId = companyPhoneId,
                DataAugmentationSessionId = sessionId,
                EditCount = 1,
                Inserted = DateTime.Now,
                Updated = DateTime.Now,
                InsertedBy = _sessionAppService.GetCurrentLoginInformations().Result.User.UserName,
                UpdatedBy = _sessionAppService.GetCurrentLoginInformations().Result.User.UserName,
                VerificationDate = DateTime.Now
            };

            _daCompanyPhoneRepository.Insert(newRec);

I dont use Azure but this is what I had to do on a 2012box.

You need to configure DNS for wildcard. You also need to setup IIS for wildcard(available in 2016 server/IIS10) or * for a dedicated IP so it always resolves to site.

What we do is make a new context for all our dbfirst models and such. This way the context AspNetZero uses isnt touched. Not sure what youre trying to do persay but this works for us and it doesnt impact what AspNetZero does or what we do.

Why not on your list of "Companies" have the options to goto documents, edit, delete, details etc? We tend to keep everything on the same page via modals. Not sure if your visual use case is different and such :)

EX: in the ... on the row we have all the options listed.

Or something like this:

Answer

@strix20 The only problem is since we are now on .net core everything is super dependent on OS and such now. For your CI info that would totally fall outside the scope of support I would say. First youre using TeamCity and Octopus (Yes we use the same process for some of our other apps, but are moving away from it). This has its own complexity and configuration beyond what should be done. Also since youre doing Angular its a slightly modified process than MVC. I guess if you were to write up a guide it for them to use it could help. We are moving away from TC to VSTS since everything all together from IDE to Azure. I personally would like to start using Docker to deploy to azure but I havent had the time to sit down and learn that yet, but I also dont expect the guys to tell me how to do it either. Again alot of the questions are basic questions that people can sit down and probably figure out, maybe its because English isnt their native language (based on how some of the questions are phrased) and trying to search for the fix might be harder? Agree the documentation is pretty good, but its also lax in other areas. Yes ASPNetZero is really just the UI components that ABP implements, which also leads to confusion on where to search. I always forget to review the ABP release notes since we are only concerned with Zero, but it looks like there some nice audition feature being pushed in the next ABP release I need to review :)

Did you redeploy the DB/run the migrations/seed?

Run a nuget restore like it says?

Answer

I know what youre saying, then every answer is: this answer is found in the xxx FAQ. Not everyone is willing to look for answers. I admit that some times Im bad, I usually put forth some effort then Im like hmm 4 answers all different and none for the past xx months. Then I say to my self Ill just post and move on to something else for the time being.

So our dev are more back end orientated so sticking with MVC was a no brainier, no need to learn that horrid language of JS :shock: And with DevExtreme everything can be handled usually pretty easy if not we make some ajax calls as needed otherwise the controls are usually ajax feed from a controller end point.

So for publishing to azure why are you guys just using VSTS to build the project on check in and run a deploy process :ugeek: its wonderful lol, set some approval gates for the Master Branch and voila all automated. I dont consider that something that should be "assisted" on per say. But I guess there is more configuration for the SPA stuff, we only publish the WEB project, no host/public site so maybe its easier.

I'm sure if you put the links and some verbiage in a GIT issue of things you think should go in the documentation they will add it. Or even the forums to pin it. I tend to find the Issues easier to read/follow then the forums.

Answer

I nominate @godrunner for this ;)

I think part of the problem is some of the things should be known or learned on your own. It shouldnt be up to the AspNetZero guys to tell you how to use NPM or GIT. Not everyone uses GIT you could use SVN or something else. These are things that should be tailored to your business process. Like how to publish a site, for us is automatic thru Visual Studio Team Services to our own IIS servers :) Im sure we have all posted stupid questions on here and are like oh that was dumb once we figured out the answer or are given it lol. The guys should focus on the product and how it functions not how you should use it.

I find it interesting you picked SPA instead of MPA, especially seeing how many JS frameworks there are. For us sticking with just MVC instead of angualr was one less thing we need to worry about since every week there is a new JS framework that everyone totes as being the best.

SQL profiler should be able to tell you whats being locked. You could also set your context to pull dirty data if you dont care.

Showing 71 to 80 of 145 entries