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

Does not contain a definition for 'DefaultEditionName' #624


User avatar
0
nipunjoshi created

I have successfully updated the V 0.7.6.But now it gives below mentioned error on the Entity Framework project.Could you tell me how to sorted it out ? Thanks in advance.

Error	4	'IP.Editions.EditionManager' does not contain a definition for 'DefaultEditionName'	IP.EntityFramework\Migrations\Seed\DefaultEditionCreator.cs	27	119	IP.EntityFramework

This is the problemed method on DefaultEditionCreator.cs

private void CreateEditions()
        {
            var defaultEdition = _context.Editions.FirstOrDefault(e => e.Name == EditionManager.DefaultEditionName);
            if (defaultEdition == null)
            {
                defaultEdition = new Edition { Name = EditionManager.DefaultEditionName, DisplayName = EditionManager.DefaultEditionName };
                _context.Editions.Add(defaultEdition);
                _context.SaveChanges();

                //TODO: Add desired features to the standard edition, if wanted!
            }
        }

7 Answer(s)
  • User Avatar
    0
    hikalkan created
    Support Team

    DefaultEditionName is a const defined in EditionManager. Can you check your EditionManager class? It should be similar like that: <a class="postlink" href="https://github.com/aspnetzero/aspnet-zero/blob/master/src/MyCompanyName.AbpZeroTemplate.Core/Editions/EditionManager.cs#L9">https://github.com/aspnetzero/aspnet-ze ... ager.cs#L9</a>

  • User Avatar
    0
    nipunjoshi created

    Yep,That is the issue.Thanks a lot :)

  • User Avatar
    0
    nipunjoshi created

    But actually it is not there on below url where you have mentioned it on the release log.I have used that to replace my one :(

    [https://github.com/aspnetboilerplate/module-zero/blob/master/src/Tests/Abp.Zero.SampleApp/Editions/EditionManager.cs])

  • User Avatar
    0
    hikalkan created
    Support Team

    Yeah, this is a SAMPLE, you can copy it if you did not costomize it. And we customized it for AspNet Zero :)

  • User Avatar
    0
    nipunjoshi created

    But the constant value is not there no ? I have just copied it and paste on my file.That's why it gave above error.If you can add that constant too then it will not give any issues in future for the guys like me. ;)

  • User Avatar
    0
    hikalkan created
    Support Team

    This const is a constant added just for AspNet Zero project and not a core part of module-zero project. So, it's not true to add there.

  • User Avatar
    0
    nipunjoshi created

    Aha.. OK sure.Thanks a lot :)