Giter VIP home page Giter VIP logo

razorpagecleanarchitecture's People

Contributors

neozhu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

razorpagecleanarchitecture's Issues

Running docker-compose -f 'docker-compose.yml' up --build resulted in an error

Running docker-compose -f 'docker-compose.yml' up --build resulted in an error. The error message is as follows:

webui_1 | ClientConnectionId:00000000-0000-0000-0000-000000000000
webui_1 | --- End of inner exception stack trace ---
webui_1 | at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
webui_1 | at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
webui_1 | at System.Threading.Tasks.Task.Wait()
webui_1 | at WorkflowCore.Services.WorkflowHost.Start()
webui_1 | at CleanArchitecture.Razor.Infrastructure.DependencyInjection.UseWorkflow(IApplicationBuilder app) in /src/src/Infrastructure/DependencyInjection.cs:line 129
webui_1 | at CleanArchitecture.Razor.Infrastructure.Extensions.ApplicationBuilderExtensions.UseInfrastructure(IApplicationBuilder app, IConfiguration config) in /src/src/Infrastructure/Extensions/ApplicationBuilderExtensions.cs:line 50
webui_1 | at Program.

$(String[] args) in /src/src/SmartAdmin.WebUI/Program.cs:line 78
webui_1 | at Program.(String[] args)
razorpagecleanarchitecture_webui_1 exited with code 139

"How can I resolve this error?"

Not sending the Application DLL in Blazor WASM

When using Blazor in WASM - I want to not send any of my business logic (Application) to the client. (I don't want them to reverse engineer it). I want to send only the things it actually needs = the DTOs.

Please can you split out the DTOs to a separate Project - e.g. Application.Dto - and make sure only that goes down the wire to the client?

Open to other ideas!

Thanks!

Issues using a db with migration

Short story, everything works UseInMemoryDatabase is true. Set that to false is when complications seem to come into existence.
First in the readme, Need to change the WebUI dir path.

dotnet ef migrations add "SampleMigration" --project src/Infrastructure --startup-project src/SmartAdmin.WebUI --output-dir Persistence/Migrations

Once this was done, I was able to update-database perfectly fine however when starting the project I get this exception on Host.Start()

MissingMethodException: Method not found: 'Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder`1<Microsoft.EntityFrameworkCore.Migrations.Operations.CreateIndexOperation> Microsoft.EntityFrameworkCore.Migrations.MigrationBuilder.CreateIndex(System.String, System.String, System.String, System.String, Boolean, System.String)'.

This exception was originally thrown at this call stack:
Microsoft.EntityFrameworkCore.Migrations.Migration.BuildOperations(System.Action<Microsoft.EntityFrameworkCore.Migrations.MigrationBuilder>)
Microsoft.EntityFrameworkCore.Migrations.Migration.UpOperations.get()
Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.GenerateUpSql(Microsoft.EntityFrameworkCore.Migrations.Migration, Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerationOptions)
Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.GetMigrationCommandLists.AnonymousMethod__2()
Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(string)
Microsoft.EntityFrameworkCore.RelationalDatabaseFacadeExtensions.Migrate(Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade)
WorkflowCore.Persistence.EntityFramework.Services.EntityFrameworkPersistenceProvider.EnsureStoreExists()
WorkflowCore.Services.WorkflowHost.StartAsync(System.Threading.CancellationToken)

I am using SQLExpress and Version 17.4.4

Thanks for any help you can provide

Adding ApplicationUser to Product as navigation property

Is it possible to add ApplicationUser to src/Domain/Entities/Product.cs as a navigation property? So that for instance when a new product is created, the product would have the id of the user that did create the product.
Suppose a scenario that I am using this architecture and I want to have ApplicationUser as the user that can make create/edit/delete on the other entities, I tried to do this, but of course I get a circular dependency error because Application projects includes Domain, and Infrastructure includes Application application, so if I would include Infrastructure in Domain a circular dependency error would be raised.
What changes could be done so that the example above would be possible to implement?
Regards. ๐Ÿ˜Š

Adding a UserProfile class

Hi,

great work here! You upgraded to .net 6 in the right way. I'm going to ask you something since it's an issue I'm facing with this architecture. Hope you help me on this.

I need to extend IdentityUser but I don't want to extend it so that I end up having my custom UsersProfile properties mixed with those in AspNetUsers table. I want to have a table for user profiles. My approach to this would be to create a Userprofile class in Domain.Entities to receive additional user info and somehow connect it with the IdentityUser. My problem is how can I have this in sync but not having to deal with IdentityUser and UserProfile in an isolated way. How could I implement this so that I could Register, update and delete users and their profiles with a single class?

Any idea on how I could achieve this? There's no examples on this feature and with this architecture.
Trying to follow this article, but would be great to have another opinion on this issue.

Battling ASP.NET Core Identity โ€“ You WILL Follow the Navigation Properties

For now, I added the UserProfile navigation property into ApplicationUser. Running a migration will add a new table UsersProfile to the database and the UserProfileId foreign key to the AspNetUsers table.

This will force to insert into the AspNetUsers table, the Id of the User profile. Is this the right approach? Should I override UserStore so that I can change how data is read and written?

public class ApplicationUser: IdentityUser<int>
    {
        public int UserProfileId { get; set; }
        public virtual UserProfile UserProfile { get; set; }
    }
namespace eCM.Core.Domain
{
    public class UserProfile: AuditEntity
    {
        /// <summary>
        /// Id of this User.
        /// </summary>
        public int Id { get; set; }

        /// <summary>
        /// Username used for login.
        /// </summary>
        public string Username { get; set; }

        /// <summary>
        /// Name shown in menus / dialogs etc.
        /// </summary>
        public string DisplayName { get; set; }

        [StringLength(50)]
        public string FirstName { get; set; }

        [StringLength(50)]
        public string LastName { get; set; }

        [NotMapped]
        public string FullName { get { 
                return $"{FirstName} {LastName}".Trim(); } 
        }

        /// <summary>
        /// User E-Mail address.
        /// </summary>
        public string Email { get; set; }

        [StringLength(50)]
        public string JobPosition { get; set; }

        /// <summary>
        /// Reference to a <see cref="File"/> containing the users photo.
        /// </summary>
        [StringLength(50)]
        public string Photo { get; set; }

        [DefaultValue(true)]
        public bool IsListed { get; set; } = true;

        [DefaultValue(false)]
        public bool IsDisabled { get; set; } = false;

        [DefaultValue(false)]
        public bool IsLocked { get; set; } = false;

        /// <summary>
        /// Timestamp of last login.
        /// </summary>
        public DateTime? LastLoginDate { get; set; }

        public DateTime? LastActivityDate { get; set; }

        /// <summary>
        /// Tracking information of IP used when the user last worked on this site. 
        /// </summary>
        public string LastIPAddress { get; set; }

        [StringLength(100)]
        public string LastSessionId { get; set; }

        [StringLength(256)]
        public string PrivateFolder { get; set; }

        public bool IsOnApproval { get; set; } = true;


        // IdentityUser properties not mapped in the User table

        [NotMapped]
        public string Password { get; set; }

        [NotMapped]
        public bool IsAuthenticated { get; set; }

        [NotMapped]
        public string Roles { get; set; }
    }
}

Thanks!

Custom manager

Is there any specific place where you would put a Custom Manager for a certain api endpoint.
Suppose that I have an api api/customers and I want to return all customers, where would make more sense to put the custom managers, so it wont violate the clean architecture principles?

Attribution

Perhaps you should attribute some credit to @jasontaylordev, your read me page still contains links to his repo's :)

Datatables

Hello!
How do I show the Datagrid in Modal dialogs?
thanks

MVC pages with scaffolder T4

Your projects are nice, can we please get CRUD MVC, I have linked custom scaffolders

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context

Customize the scaffolds
https://github.com/ZeekoZhu/TextTemplatingCore
https://docs.microsoft.com/en-us/archive/msdn-magazine/2014/june/asp-net-mvc-override-the-default-scaffold-templates

Link

<#@ template language="C#" HostSpecific="True" #>
<#@ output extension=".cshtml" #>
<#@ include file="Imports.include.t4" #>
@model IEnumerable<#= "<" + ViewDataTypeName + ">" #>
<#
// The following chained if-statement outputs the file header code and markup for a partial view, a view using a layout page, or a regular view.
if(IsPartialView) {
#>

<#
} else if(IsLayoutPageSelected) {
#>

@{
    ViewBag.Title = "<#= ViewName#>";
<#
if (!String.IsNullOrEmpty(LayoutPageFile)) {
#>
    Layout = "<#= LayoutPageFile#>";
<#
}
#>
}

<h2><#= ViewName#></h2>

<#
} else {
#>

@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title><#= ViewName #></title>
</head>
<body>
<#
    PushIndent("    ");
}
#>
<div class="row">
    <div class="large-12 medium-12 small-12 columns">
        
<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table class="table">
    <tr>
<#
IEnumerable<PropertyMetadata> properties = ModelMetadata.Properties;
foreach (PropertyMetadata property in properties) {
    if (property.Scaffold && !property.IsPrimaryKey && !property.IsForeignKey) {
#>
<#
        // We do not want to show any association properties for which there is
        // no associated foreign key.
        if (property.IsAssociation && GetRelatedModelMetadata(property) == null) {
            continue;
        }
#>
        <th>
            @Html.DisplayNameFor(model => model.<#= GetValueExpression(property) #>)
        </th>
<#
    }
}
#>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
<#
foreach (PropertyMetadata property in properties) {
    if (property.Scaffold && !property.IsPrimaryKey && !property.IsForeignKey) {
#>
<#
        // We do not want to show any association properties for which there is
        // no associated foreign key.
        if (property.IsAssociation && GetRelatedModelMetadata(property) == null) {
            continue;
        }
#>
        <td>
            @Html.DisplayFor(modelItem => <#= "item." + GetValueExpression(property) #>)
        </td>
<#
    }
}

string pkName = GetPrimaryKeyName();
if (pkName != null) {
#>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.<#= pkName #> }) |
            @Html.ActionLink("Details", "Details", new { id=item.<#= pkName #> }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.<#= pkName #> })
        </td>
<#
} else {
#>
        <td>
            @Html.ActionLink("Edit", "Edit", new { /* id=item.PrimaryKey */ }) |
            @Html.ActionLink("Details", "Details", new { /* id=item.PrimaryKey */ }) |
            @Html.ActionLink("Delete", "Delete", new { /* id=item.PrimaryKey */ })
        </td>
<#
}
#>
    </tr>
}

</table>

    </div>
</div>

<#
// The following code closes the tag used in the case of a view using a layout page and the body and html tags in the case of a regular view page
#>
<#
if(!IsPartialView && !IsLayoutPageSelected) {
    ClearIndent();
#>
</body>
</html>
<#
}
#>
<#@ include file="ModelMetadataFunctions.cs.include.t4" #>

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.