tru fix
This commit is contained in:
parent
9470afb737
commit
31ac58f274
|
@ -36,6 +36,8 @@ namespace MapTo.Extensions
|
||||||
.WriteComment($" Type {item.Type}")
|
.WriteComment($" Type {item.Type}")
|
||||||
.WriteComment($" MappedSourcePropertyTypeName {item.MappedSourcePropertyTypeName}")
|
.WriteComment($" MappedSourcePropertyTypeName {item.MappedSourcePropertyTypeName}")
|
||||||
.WriteComment($" IsEnumerable {item.IsEnumerable}")
|
.WriteComment($" IsEnumerable {item.IsEnumerable}")
|
||||||
|
.WriteComment($" FullyQualifiedType {item.FullyQualifiedType}")
|
||||||
|
.WriteComment($" EnumerableTypeArgument {item.EnumerableTypeArgument}")
|
||||||
.WriteComment($" SourcePropertyName {item.SourcePropertyName}")
|
.WriteComment($" SourcePropertyName {item.SourcePropertyName}")
|
||||||
.WriteComment($" TypeSymbol {item.FullyQualifiedType.ToString()}")
|
.WriteComment($" TypeSymbol {item.FullyQualifiedType.ToString()}")
|
||||||
.WriteComment($" isReadOnly {item.isReadOnly.ToString()}")
|
.WriteComment($" isReadOnly {item.isReadOnly.ToString()}")
|
||||||
|
|
|
@ -10,7 +10,7 @@ namespace MapTo.Extensions
|
||||||
{
|
{
|
||||||
internal static SourceCode GenerateStructOrClass(this MappingModel model, string structOrClass)
|
internal static SourceCode GenerateStructOrClass(this MappingModel model, string structOrClass)
|
||||||
{
|
{
|
||||||
const bool writeDebugInfo = false;
|
const bool writeDebugInfo = true;
|
||||||
|
|
||||||
using var builder = new SourceBuilder()
|
using var builder = new SourceBuilder()
|
||||||
.WriteLine(GeneratedFilesHeader)
|
.WriteLine(GeneratedFilesHeader)
|
||||||
|
@ -66,7 +66,7 @@ namespace MapTo.Extensions
|
||||||
|
|
||||||
foreach (var property in model.TypeProperties)
|
foreach (var property in model.TypeProperties)
|
||||||
{
|
{
|
||||||
if (!model.SourceProperties.IsMappedProperty(property))
|
if (!model.TypeProperties.IsMappedProperty(property))
|
||||||
{
|
{
|
||||||
stringBuilder.Append(", ");
|
stringBuilder.Append(", ");
|
||||||
stringBuilder.Append($"{property.FullyQualifiedType} {property.SourcePropertyName.ToCamelCase()}");
|
stringBuilder.Append($"{property.FullyQualifiedType} {property.SourcePropertyName.ToCamelCase()}");
|
||||||
|
@ -88,7 +88,7 @@ namespace MapTo.Extensions
|
||||||
|
|
||||||
foreach(var prop in properties)
|
foreach(var prop in properties)
|
||||||
{
|
{
|
||||||
if (prop.FullyQualifiedType == property.FullyQualifiedType) return true;
|
if (prop.FullyQualifiedType.ToString() == property.FullyQualifiedType.ToString()) return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -20,6 +20,7 @@ namespace BlueWest.Data
|
||||||
Sell
|
Sell
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[MapFrom(typeof(FinanceTransactionInsertDto))]
|
||||||
public partial struct FinanceTransaction
|
public partial struct FinanceTransaction
|
||||||
{
|
{
|
||||||
public int Id { get; }
|
public int Id { get; }
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace BlueWest.Data
|
||||||
|
{
|
||||||
|
|
||||||
|
public partial struct FinanceTransactionInsertDto
|
||||||
|
{
|
||||||
|
public int UserId { get; set; }
|
||||||
|
public FinanceTransactionType FinanceTransactionType { get; }
|
||||||
|
public FinanceSymbol FinanceSymbol { get; }
|
||||||
|
public double Amount { get; } // To Buy
|
||||||
|
public double Quantity { get; } // Bought
|
||||||
|
public double Fee { get; }
|
||||||
|
public DateTime DateTime { get; }
|
||||||
|
}
|
||||||
|
}
|
|
@ -7,9 +7,8 @@ namespace BlueWest.Data
|
||||||
{
|
{
|
||||||
[MapFrom(typeof(FinanceTransaction))]
|
[MapFrom(typeof(FinanceTransaction))]
|
||||||
|
|
||||||
public partial struct FinanceTransactionReadDto
|
partial struct FinanceTransactionReadDto
|
||||||
{
|
{
|
||||||
public int Id { get; set; }
|
|
||||||
public int UserId { get; set; }
|
public int UserId { get; set; }
|
||||||
public FinanceTransactionType FinanceTransactionType { get; }
|
public FinanceTransactionType FinanceTransactionType { get; }
|
||||||
public FinanceSymbol FinanceSymbol { get; }
|
public FinanceSymbol FinanceSymbol { get; }
|
||||||
|
|
|
@ -11,7 +11,6 @@ namespace BlueWest.Data
|
||||||
Users = users;
|
Users = users;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public int Length => Users.Count;
|
public int Length => Users.Count;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -15,7 +15,5 @@ namespace BlueWest.Data
|
||||||
public double BTCAmount { get; set; }
|
public double BTCAmount { get; set; }
|
||||||
public double LTCAmount { get; set; }
|
public double LTCAmount { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,15 +0,0 @@
|
||||||
using System;
|
|
||||||
using BlueWest.Data;
|
|
||||||
using MapTo;
|
|
||||||
using TestConsoleApp.Data.Models;
|
|
||||||
|
|
||||||
namespace TestConsoleApp.ViewModels
|
|
||||||
{
|
|
||||||
[MapFrom(typeof(User))]
|
|
||||||
public partial struct UserViewModel
|
|
||||||
{
|
|
||||||
public int Id { get; set; }
|
|
||||||
|
|
||||||
public DateTimeOffset RegisteredAt { get; }
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue