Giter VIP home page Giter VIP logo

prmtoolkit.notificationpattern's Issues

The entity type 'Notification' requires a primary key to be defined.

Adicionei a validação na minha classe de entidade conforme abaixo, e no momento de gerar atualizar minha base de dados via migration (update-database), foi me retornado a seguinte mensagem: "The entity type 'Notification' requires a primary key to be defined."

using Imperium.Domain.Entities.Base;
using Imperium.Domain.Enums;
using Imperium.Domain.ValueObjects;
using prmToolkit.NotificationPattern;

namespace Imperium.Domain.Entities
{
public class Company : EntityBase
{
public string CompanyName { get; private set; }
public string FantasyName { get; private set; }
public Email Email { get; private set; }
public string CNPJ { get; private set; }
public Address Address { get; private set; }
public EnumStatus Status { get; private set; }

	private Company()
	{
	}

	public Company(string companyName, string fantasyName, Email email, string cnpj)
	{
		CompanyName = companyName;
		FantasyName = fantasyName;
		Email = email;
		CNPJ = cnpj;

		new AddNotifications<Company>(this).IfNotCnpj(x => x.CNPJ);
	}

	public Company(string companyName, string fantasyName, Email email, string cnpj, Address address)
	{
		CompanyName = companyName;
		FantasyName = fantasyName;
		Email = email;
		CNPJ = cnpj;
		Address = address;
		Status = EnumStatus.Pendente;
	}
}

}

using prmToolkit.NotificationPattern;
using System;
using System.ComponentModel.DataAnnotations;

namespace Imperium.Domain.Entities.Base
{
public abstract class EntityBase : Notifiable
{
[Key]
public Guid Id { get; private set; }

	protected EntityBase()
	{
		Id = Guid.NewGuid();
	}
}

}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.