Compare commits

..

No commits in common. "194fb862ea500b143747effc156b01236ec8f878" and "fc754a077a5da137144754ac2d7d62f3ca1fbb47" have entirely different histories.

6 changed files with 7 additions and 34 deletions

View File

@ -79,9 +79,6 @@ namespace TIAM.Database.DbContexts.Admins
new EmailMessageEntityTypeDefaultConfigurations().Configure(modelBuilder.Entity<EmailMessage>()); new EmailMessageEntityTypeDefaultConfigurations().Configure(modelBuilder.Entity<EmailMessage>());
modelBuilder.Entity<Company>().Navigation(e => e.Profile).AutoInclude(true);
modelBuilder.Entity<Company>().HasOne(x => x.Profile).WithOne().OnDelete(DeleteBehavior.Cascade);
//modelBuilder.Entity<UserProductToCar>().Ignore(x => x.Id); //modelBuilder.Entity<UserProductToCar>().Ignore(x => x.Id);
//modelBuilder.Entity<Car>().Ignore(x => x.Id); //modelBuilder.Entity<Car>().Ignore(x => x.Id);
////modelBuilder.Entity<UserProductToCars>().Ignore(x => x.Cars); ////modelBuilder.Entity<UserProductToCars>().Ignore(x => x.Cars);

View File

@ -128,6 +128,6 @@ namespace TIAM.Database.DbContexts.Admins
public static bool UpdateServiceProvider(this IAdminDbContext ctx, Company serviceProvider) public static bool UpdateServiceProvider(this IAdminDbContext ctx, Company serviceProvider)
=> ctx.ServiceProviders.Update(serviceProvider).State == EntityState.Modified; => ctx.ServiceProviders.Update(serviceProvider).State == EntityState.Modified;
} }
} }

View File

@ -7,18 +7,4 @@ namespace TIAM.Entities.Addresses;
[Table(nameof(Address))] [Table(nameof(Address))]
public class Address : AcAddress, IAddress public class Address : AcAddress, IAddress
{ {
public Address() : base()
{ }
public Address(Guid id) : base(id)
{
}
public Address(Guid id, string? addressText) : base(id, addressText)
{
}
public Address(Guid id, double? latitude, double? longitude, string? addressText) : base(id, latitude, longitude, addressText)
{
}
} }

View File

@ -7,12 +7,5 @@ namespace TIAM.Entities.Profiles;
[Table(nameof(Profile))] [Table(nameof(Profile))]
public class Profile : AcProfile<Address>, IProfile<Address> public class Profile : AcProfile<Address>, IProfile<Address>
{ {
public Profile() : base()
{ }
public Profile(Guid id) : base(id)
{ }
public Profile(Guid id, string name) : base(id, name)
{ }
} }

View File

@ -152,7 +152,10 @@ namespace TIAMSharedUI.Pages.Components
//the following line creates a lambda expression that returns the value of the property //the following line creates a lambda expression that returns the value of the property
var lambda = Expression.Lambda(typeof(Func<>).MakeGenericType(property.PropertyType), access); var lambda = Expression.Lambda(typeof(Func<>).MakeGenericType(property.PropertyType), access);
_logger.DetailConditional($"{property.Name}, {property.GetType().FullName}; lambda: {lambda.ToString()}"); _logger.DetailConditional($"{property.Name}, {property.GetType().FullName}");
_logger.DetailConditional(lambda.ToString());
_logger.DetailConditional($"lambda: {lambda.ToString()}");
layoutItemBuilder.OpenElement(i++, "div");//open div layoutItemBuilder.OpenElement(i++, "div");//open div
layoutItemBuilder.AddAttribute(i++, "id", stepId.ToString()); layoutItemBuilder.AddAttribute(i++, "id", stepId.ToString());
@ -505,7 +508,7 @@ namespace TIAMSharedUI.Pages.Components
layoutItemBuilder.CloseElement(); layoutItemBuilder.CloseElement();
//_logger.DetailConditional($"loop {k}, length: {length}, formSteps: {FormSteps.Count} "); _logger.DetailConditional($"loop {k}, length: {length}, formSteps: {FormSteps.Count} ");
k++; k++;
} }

View File

@ -14,8 +14,6 @@ using TIAM.Entities.Transfers;
using System.Text.Json.Nodes; using System.Text.Json.Nodes;
using System.Text.Json; using System.Text.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using TIAM.Entities.Addresses;
using TIAM.Entities.Profiles;
namespace TIAMWebApp.Server.Controllers namespace TIAMWebApp.Server.Controllers
{ {
@ -81,10 +79,6 @@ namespace TIAMWebApp.Server.Controllers
GlobalLogger.Info($@"ServiceProvider to be created: {id}, {name}, {ownerId}"); GlobalLogger.Info($@"ServiceProvider to be created: {id}, {name}, {ownerId}");
Company toCreate = new Company(id, name, ownerId, Guid.NewGuid()); Company toCreate = new Company(id, name, ownerId, Guid.NewGuid());
toCreate.CommissionPercent = commissionRate; toCreate.CommissionPercent = commissionRate;
toCreate.SetProfile(new Profile(Guid.NewGuid(), toCreate.Name));
toCreate.Profile.SetAddress(new Address(Guid.NewGuid(), "Controller CreateServiceProvider; address text..."));
var result = await _adminDal.CreateServiceProviderAsync(toCreate); var result = await _adminDal.CreateServiceProviderAsync(toCreate);
if (!result) if (!result)
{ {