eduardopires / equinoxproject Goto Github PK
View Code? Open in Web Editor NEWFull ASP.NET Core 6 application with DDD, CQRS and Event Sourcing concepts
Home Page: http://equinoxproject.azurewebsites.net/
License: MIT License
Full ASP.NET Core 6 application with DDD, CQRS and Event Sourcing concepts
Home Page: http://equinoxproject.azurewebsites.net/
License: MIT License
Hello @EduardoPires I have built my project around EquinoxProject was wondering can you help me with something?
Hi,
This is a great project for me to learn and contribute.
I have cloned and running it to test.
Is there a document or e-book available for better understanding the details?
Thanks.
Pires acredito que seria interessante um exemplo de boas praticas para implementar testes end to end. Talvez com Xunit
Good afternoon.
Does not work removal Customers. The necessary rights to delete were issued when the user was created:
public async Task Register(RegisterViewModel model, string returnUrl = null)
{
....
user.Claims.Add(new IdentityUserClaim
{
ClaimType = "Customers",
ClaimValue = "Write"
});
user.Claims.Add(new IdentityUserClaim
{
ClaimType = "Customers",
ClaimValue = "Remove"
});
....
}
But when you delete Customers, redirect to the page "Access Denied".
If calls are rearranged in places, create a new user, logs in under it, then deletion starts to work, but creation and editing does not work.
Quando será lançado a versão 2.0?
Hello Eduardo,
I don't know why but the user can't register a new customer: "You don't have enough access.". If I change [Authorize(Policy = "CanWriteCustomerData")] to [Authorize] it works.
In my next project I would like to use this as an starting point, however we also need to create a REST API to expose system functionality, where would this project fit in the entire architecture?
Can you please add a complicated MODEL and show how can we implement ONE-Many and Many-Many relations also?.
Olá Eduardo, tudo bem? Notei que você teve que fazer uma esquema para conseguir mapear os campos dentro de classe separada, porem o método ToTable não veio na extensão que você criou, forçando então ter que criar no método OnModelCreating da classe Context.
Teria alguma sugestão?
Tks
Hello @EduardoPires im trying to update-database
the database but its giving me the error below can you maybe assist me with this problem?
PM> Update-Database
System.ArgumentNullException: Value cannot be null.
Parameter name: connectionString
at Microsoft.EntityFrameworkCore.Utilities.Check.NotEmpty(String value, String parameterName)
at Microsoft.EntityFrameworkCore.SqlServerDbContextOptionsExtensions.UseSqlServer(DbContextOptionsBuilder optionsBuilder, String connectionString, Action`1 sqlServerOptionsAction)
at Panda.Web.Startup.<ConfigureServices>b__4_0(DbContextOptionsBuilder options) in C:\Users\nico\Documents\Visual Studio 2017\Projects\Panda\Panda.Web\Startup.cs:line 37
at Microsoft.Extensions.DependencyInjection.EntityFrameworkServiceCollectionExtensions.DbContextOptionsFactory[TContext](IServiceProvider applicationServiceProvider, Action`2 optionsAction)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.<>c__DisplayClass16_0.<RealizeService>b__0(ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitClosedIEnumerable(ClosedIEnumerableCallSite closedIEnumerableCallSite, ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitTransient(TransientCallSite transientCallSite, ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.<>c__DisplayClass16_0.<RealizeService>b__0(ServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
at Microsoft.EntityFrameworkCore.Design.Internal.DbContextOperations.FindContextTypes()
at Microsoft.EntityFrameworkCore.Design.Internal.DbContextOperations.FindContextType(String name)
at Microsoft.EntityFrameworkCore.Design.Internal.DbContextOperations.CreateContext(String contextType)
at Microsoft.EntityFrameworkCore.Design.Internal.MigrationsOperations.UpdateDatabase(String targetMigration, String contextType)
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.UpdateDatabase.<>c__DisplayClass0_1.<.ctor>b__0()
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execute(Action action)
**Value cannot be null.**
appsettings.json
{
"ConnectionStrings": {
"DefaultConnection": "Server=(localdb)\\mssqllocaldb;Database=Panda;Trusted_Connection=True;MultipleActiveResultSets=true"
},
"Logging": {
"IncludeScopes": false,
"LogLevel": {
"Default": "Debug",
"System": "Information",
"Microsoft": "Information"
}
}
}
hi there,
How can I have async Controllers in the project?
It would be great if you have guide me on that. And also do I need to use MQ or MediatR etc. for Async operation?
Please let me know
Thanks & Regards,
Sunny Dave
Hello,
The road map mentions a new front end. Will it still be pure ASP.NET MVC or will you use a JavaScript framework?
Thanks, and can't wait for Version 2!
How can I handle the validation of a unique customer name?
Implements a further segregation of Identity service and use IdentityServer4 and full isolate it as running service.
in the Ioc project the following
services.AddScoped<INotificationHandler, CustomerCommandHandler>();
causes the CustomerCommandHandler Handle method to run twice!
Hello,
How can I run both weapi and and site ?
If I go to the webapi folder and run the dotnet run command, I can't access the site URL. The same if I run dotnet run in the site folder..
Thanks.
Hi,
i'd like to know if you could please make your version 2 branch public?
Because i like to compare the concepts you plan to use.
Regards
Event sourcing mainly is composed by objects notation data. So, reduce friction and (des) serializations persisting them as documents.
Hello, Eduardo.
I've seen the closed topics regarding this issue, but even with the changes proposed either by you or some other users, I still can't remove a Customer
. I'm being redirected to the Access Denied page.
EDIT: The Azure project is not working either.
Thanks so far.
Could you add a components diagram like layer diagram or so.
It will help to understand relations and whole architecture.
I am trying to use Migrations beside sql script
But migrations' some is in Equinox.Infra.CrossCutting.Identity and others in Equinox.Infra.Data
how to use them
--- after afew try
dotnet ef database update --context EquinoxContext --startup-project ../Equinox.UI.Site
dotnet ef database update --context EventStoreSQLContext --startup-project ../Equinox.UI.Site
commands worked fine but what about
Infra.CrossCutting.Identity project migrations ?
regards
I'm developing a Web API with .Net core api 1.1. After searching I can't find any document or sample that use authorization without the use of Entity Framework. Instead of this i need to use dapper with a mysql connector in order to connect my app with a mysql server. Is it possible to do it with your library ? If yes please can i have an example ?
Hi,
How to ignore all destination members, except the ones that are mapped? I tested all the solutions of the forums but it does not work !
Thanks
hello,i have a question ?,How does this file work? i can't find an entry of this file?
or this file did't work ?
Hi,
Thanks for this effort, it is really valuable for a lot of people.
I have a question about validation from some time ago and it applies to this type of architecture. This project is using FluentValidation to specify validation rules on the domain level, and then it uses Data Annotations to specify validation on the application level, is there a way to not specify the validation rules in multiple parts of the application? or is this the recommended way to do it?
Hey folks,
I'm beginning the unit tests in this project.
What are your suggestions for the frameworks?
My suggestions are XUnit and NSubstitute.
Hi Eduardo.
I have read in some article that the application layer is the layer responsible for controlling the transactions carried out by the application.
However, in this project the transactions are being commited in Command handlers.
Of course, it would be quiet to inject an IUnityOfWork implementation into the application services, but with that, we would lose the benefit of launching domain events after the commit is completed, from the domain.
It would be kind of weird, like ... Let's launch a domain event, starting from the application layer. O.0
So I'm in a dilemma.
Can I commit the transaction from the domain, or should we improve the design? And besides, how to improve the design?
Thanks for listening!
Bonjour,
Nous ajoutons une colonne "Adresse" à l'entité "Customer". Lors de l'insertion d'une nouvelle ligne, nous affectons la valeur : "Mon-Adresse" à la propriété "Adresse". Maintenant si nous souhaitons modifier toutes les colonnes de l'entité "Customer" sauf "Adresse", cette dernière se retrouve avec dans la base de données : son ancienne valeur a été écrasée.
Merci
Hi
I need to use dropdown. So for example i need to add this
public IEnumerable<SelectListItem> CreditCards { get; set;
to
CustomerViewModel
but SelectListItem is part of Microsoft.AspNetCore.Mvc.ViewFeatures.dll
Is it correct to add MVC dependency to Application project?
Thanks
Hi,
My existing database does not have a GUID as primary key for all the tables. What should I do now?.
is there anyone worked for paged resultset, for this project.
https://github.com/digipolisantwerp/dataaccess_aspnetcore
Is it possible to write logs into files? and where is the default log file location?
I wonder if I can user Nlogger in the project?
Hello,
Let's consider a scenario that we are creating new customer. If I understand correctly, CustomerViewModel's
validation is performed firstly on object passed from POST, i.e. on ModelState
.
src/Equinox.Application/ViewModels/CustomerViewModel.cs
Then the RegisterNewCustomerCommand
is executed and validation is performed using RegisterNewCustomerCommandValidation
.
src/Equinox.Domain/Validations/RegisterNewCustomerCommandValidation.cs
I've noticed that there is a difference between the way that CustomerViewModel
is being validated in the first step mentioned above and the second one - the name's max length differs.
src/Equinox.Application/ViewModels/CustomerViewModel.cs#L14
src/Equinox.Domain/Validations/CustomerValidation.cs#L13
I aware that it is trivial issue, but maybe it would be better to abstract those validation constants to some static class? Or maybe the validation step should be performed just once?
Please let me know what you think about it 😄
Thanks.
I have a problem with visual studio 2017 15.3.3 version.
I am trying to use core 2.0 version of this project. clonned and
if i run with F5 then works well, dotnet run works well,
but if i use right click wwwroot and select Wiev In Browser kestrel gives some error that i could not solve.
Equinox.UI.Site> Now listening on: http://localhost:18888
Equinox.UI.Site> Application started. Press Ctrl+C to shut down.
Equinox.UI.Site> info: Microsoft.AspNetCore.Server.Kestrel[17]
Equinox.UI.Site> Connection id "0HL7PLV6P81VF" bad request data: "Malformed request: invalid headers."
Equinox.UI.Site> Microsoft.AspNetCore.Server.Kestrel.Core.BadHttpRequestException: Malformed request: invalid headers.
Equinox.UI.Site> at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Frame1.<ProcessRequestsAsync>d__2.MoveNext() Equinox.UI.Site> info: Microsoft.AspNetCore.Server.Kestrel[17] Equinox.UI.Site> Connection id "0HL7PLV6P81VF" bad request data: "Malformed request: invalid headers." Equinox.UI.Site> Microsoft.AspNetCore.Server.Kestrel.Core.BadHttpRequestException: Malformed request: invalid headers. Equinox.UI.Site> at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Frame
1.d__2.MoveNext()
Equinox.UI.Site> info: Microsoft.AspNetCore.Server.Kestrel[17]
Equinox.UI.Site> Connection id "0HL7PLV6P81VG" bad request data: "Malformed request: invalid headers."
Equinox.UI.Site> Microsoft.AspNetCore.Server.Kestrel.Core.BadHttpRequestException: Malformed request: invalid headers.
Equinox.UI.Site> at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Frame1.<ProcessRequestsAsync>d__2.MoveNext() Equinox.UI.Site> info: Microsoft.AspNetCore.Server.Kestrel[17] Equinox.UI.Site> Connection id "0HL7PLV6P81VG" bad request data: "Malformed request: invalid headers." Equinox.UI.Site> Microsoft.AspNetCore.Server.Kestrel.Core.BadHttpRequestException: Malformed request: invalid headers. Equinox.UI.Site> at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Frame
1.d__2.MoveNext()
Hello Eduardo
I came across this github repo and its amazing, exactly what I was looking for. However classes are not documented and for a person who doesnt know about DDD a lot then its hard to understand.
Can you please point me in the right direction of what to read first before I can understand your code.
I found these posts but they are quite old and not sure if you took some code from these blog posts (eg EntityBase)
@EduardoPires porque um domain e um domain.core? Qual a definição para essa separação?
What is the best way to work between entities that have navigation properties?
namespace Equinox.Domain.Models
{
public class Customer : Entity
{
public Customer(Guid id, string name, string email, DateTime birthDate)
{
Id = id;
Name = name;
Email = email;
BirthDate = birthDate;
}
// Empty constructor for EF
protected Customer() { }
public string Name { get; private set; }
public string Email { get; private set; }
public DateTime BirthDate { get; private set; }
public List<CustomerAdress> CustomerAdresses { get; set; }
}
public class CustomerAdress : Entity
{
public CustomerAdress(Guid id, string name, string country, string region, Guid customerId)
{
Id = id;
Name = name;
Country = country;
Region = region;
CustomerId = customerId;
}
protected CustomerAdress() { }
public string Name { get; private set; } // Home | Work
public string Country { get; private set; }
public string Region { get; private set; }
// ...
public Guid CustomerId { get; private set; }
public Customer Customer { get; set; }
}
}
Map:
namespace Equinox.Infra.Data.Mappings
{
public class CustomerMap : EntityTypeConfiguration<Customer>
{
public override void Map(EntityTypeBuilder<Customer> builder)
{
builder.Property(c => c.Id)
.HasColumnName("Id");
builder.Property(c => c.Name)
.HasColumnType("varchar(100)")
.HasMaxLength(100)
.IsRequired();
builder.Property(c => c.Email)
.HasColumnType("varchar(100)")
.HasMaxLength(11)
.IsRequired();
builder.HasMany(c => c.CustomerAdresses)
.WithOne(c => c.Customer)
.HasConstraintName("FK_Customer_CustomerAdress");
}
}
}
How should it be repositories and domain events etc. in this stutation ?
it would be great if there were plugin management
Hello.
Can you please tell me when you plan to release 2.0?
You wrote in the roadmap first quarter.
Hi,
The system has a XSS vulnerability in the auditing/history page.
The JSON data received by the ajax request is not being html-encoded.
In the user register function It would be nice to add the email message to a db table queue
and a scheduled task that sends it,
this is to have a receipt for all outgoing messages
Hello, I would like to know how do I use the ValueObject
class, can you provide an example of how do you use this class? I know it came from DDD but I never really used it before.
Please add a Docker support to run this project.
Any proposal for Saga implementation?
Hello Eduardo,
I've implemented JWT access token in WebApi project. I'm trying to send a pull request to your branch but I haven't authorization.
How to migrate to MySQL or
use together MySQL and MsSQL
https://github.com/damienbod/AspNetCoreMultipleProject/tree/master/src/AspNetCoreMultipleProject
thanks for help.
I would like to know if you have plans to add support for multi tenancy.
Service layer should always return database domain entities instead on DTO/ViewModels.
Do not user mapping (e.g. using automapper) in service, do it in controller instead.
e.g.
CustomerAppService.GetById(x) => Customer
instead of
CustomerAppService.GetById(x) => CustomerViewModel
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.