Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC

Activities of "martin"

Thanks for the information, very helpfull as always.

To sum up :-

Make sure you have everything installed at https://docs.aspnetzero.com/documents/zero/latest/Getting-Started-Core#prerequirements

Ensure you follow ALL the steps in https://docs.aspnetzero.com/documents/zero/latest/Getting-Started-Core (pay close attention to https://docs.aspnetzero.com/documents/zero/latest/Getting-Started-Core#configure-the-project)

Do NOT include the node_modules folder into GitHub (which is why I got the problem)

If are attempting to copy a project from one PC to another I would suggest getting a FULL copy of the project files. That way if you need to you can copy the missing files (in my case the files in node_modules) you can just replace them. (Which is what I ended up doing)

To reiterate the issue I have is NOT with any of the tools, it is with the fact that Visual Studio/GitHub doesn't keep a copy of the files in node_modules (and maybe some other files as far as I can tell), so when I downloaded a copy from GitHub it was missing some required files.

In my case I had to take a complete copy of my project home on a USB thumb drive and copy over the project on the other PC. Everything works fine after that.

I suspect removing some of the file entires from the bundle-config.json and the package-mapping-config.js might not be a good idea. Since some of the missing components would be needed to run the solution correctly.

Answer

I am actually the OP, I was using the company account and my boss set me up with my own login. Thanks for the starting keywords and code locations by the way maliming they were very helpful.

Anyway here is what I ended up doing. I am still learning so I think it would be smart to put up a potential solution in case someone else can benefit from this.

TenantManger.cs

   .
        private readonly TenantSeedDataBuilder _seedDataBuilder;        
        .
        
                    await _demoDataBuilder.BuildForAsync(tenant);
                    await _seedDataBuilder.BuildForAsync(tenant);

TenantSeedDataBuilder.cs

    public class TenantSeedDataBuilder : CrazyCatLadyDemoServiceBase, ITransientDependency
    {
        private readonly IRepository<State, long> _stateRepository;
        private State state;

        public TenantSeedDataBuilder(
            IRepository<State, long> stateRepository)
        {
            _stateRepository = stateRepository;
        }

        public async Task BuildForAsync(Tenant tenant)
        {
            using (CurrentUnitOfWork.SetTenantId(tenant.Id))
            {
                BuildForInternal(tenant);
                await CurrentUnitOfWork.SaveChangesAsync();
            }
        }

        private void BuildForInternal(Tenant tenant)
        {
            string[] stateArray = {"Queensland", "New South Wales", "Australian Capital Territory",
                                   "Victoria", "Tasmania", "South Australia", "Western Australia",
                                   "Northern Territory" };

            foreach (string item in stateArray)
            {
                state = new State
                {
                    TenantId = tenant.Id,
                    Name = item
                };
                _stateRepository.Insert(state);
            }
        }
    }

So what this does is create some seed values for states everytime a Tenant is created. Any feedback would be welcome of course. :-)

Showing 21 to 23 of 23 entries