nlohim
nlohim
CC#
Created by nlohim on 1/25/2023 in #help
✅ LINQ GroupBy error
/close
26 replies
CC#
Created by nlohim on 1/25/2023 in #help
✅ LINQ GroupBy error
I have tried that by calling ToList() before GroupBy(), the result is the same error
26 replies
CC#
Created by nlohim on 1/25/2023 in #help
✅ LINQ GroupBy error
Yeah ofc, it wouldn't compile otherwise
26 replies
CC#
Created by nlohim on 1/25/2023 in #help
✅ LINQ GroupBy error
I tried awaiting, didn't work
26 replies
CC#
Created by nlohim on 1/25/2023 in #help
✅ LINQ GroupBy error
I'm using MSSQL
26 replies
CC#
Created by nlohim on 1/25/2023 in #help
✅ LINQ GroupBy error
@Ayymoss this is GroupBy not Where
26 replies
CC#
Created by nlohim on 1/17/2023 in #help
❔ EF inheritance, selecting from multiple children
Thank you ❤️
27 replies
CC#
Created by nlohim on 1/17/2023 in #help
❔ EF inheritance, selecting from multiple children
It is what it is now
27 replies
CC#
Created by nlohim on 1/17/2023 in #help
❔ EF inheritance, selecting from multiple children
I wasn't part of the decision making for this project 😦
27 replies
CC#
Created by nlohim on 1/17/2023 in #help
❔ EF inheritance, selecting from multiple children
If you make the base entity abstract, EF will create a separate table for each child instead of 1 table
27 replies
CC#
Created by nlohim on 1/17/2023 in #help
❔ EF inheritance, selecting from multiple children
I may be wrong, but I don't think it would matter much. I can try to declare the inheritance classes' DbSets in the base context, I believe the result will be the same
27 replies
CC#
Created by nlohim on 1/17/2023 in #help
❔ EF inheritance, selecting from multiple children
We have many contexts, 1 for each feature
27 replies
CC#
Created by nlohim on 1/17/2023 in #help
❔ EF inheritance, selecting from multiple children
Anything else?
27 replies
CC#
Created by nlohim on 1/17/2023 in #help
❔ EF inheritance, selecting from multiple children
BaseDbContext:
public class BaseSpecificationContext : BaseContext
{
public BaseSpecificationContext(IConfiguration configuration) : base(configuration)
{
}

public BaseSpecificationContext()
{
}

public DbSet<ProcessSpec> ProcessSpec { get; set; }
}

DbContext 2:
public class SpecificationContext_19 : BaseSpecificationContext
{
public SpecificationContext_19(IConfiguration configuration) : base(configuration)
{
}

public SpecificationContext_19()
{
}

public new DbSet<ProcessSpecMevex> ProcessSpec { get; set; }
}
BaseDbContext:
public class BaseSpecificationContext : BaseContext
{
public BaseSpecificationContext(IConfiguration configuration) : base(configuration)
{
}

public BaseSpecificationContext()
{
}

public DbSet<ProcessSpec> ProcessSpec { get; set; }
}

DbContext 2:
public class SpecificationContext_19 : BaseSpecificationContext
{
public SpecificationContext_19(IConfiguration configuration) : base(configuration)
{
}

public SpecificationContext_19()
{
}

public new DbSet<ProcessSpecMevex> ProcessSpec { get; set; }
}
27 replies
CC#
Created by nlohim on 1/17/2023 in #help
❔ EF inheritance, selecting from multiple children
inheritance 2:
public class ProcessSpecBeam : ProcessSpec
{
/// <summary>
///
/// </summary>
public ProcessSpecMevex()
{
}

/// <summary>
/// Specifies the type of ProcessSpec, including the form configuration.
/// </summary>
public int? ProcessSpecTypeId { get; set; }

/// <summary>
/// Specifies which label option will be used by this Process Spec.
/// </summary>
public int? LabelOptionId { get; set; }

/// <summary>
/// Specifies the orientation of the barcode on the label.
///
/// Note: Perhaps this could be added to Shipper or LoadingPattern?
/// </summary>
public int? BarcodeOrientationId { get; set; }

/// <summary>
/// Specifies whether the carrier dimensions will be used for the process.
/// </summary>
public bool UseCarrierAssociations { get; set; }
}
inheritance 2:
public class ProcessSpecBeam : ProcessSpec
{
/// <summary>
///
/// </summary>
public ProcessSpecMevex()
{
}

/// <summary>
/// Specifies the type of ProcessSpec, including the form configuration.
/// </summary>
public int? ProcessSpecTypeId { get; set; }

/// <summary>
/// Specifies which label option will be used by this Process Spec.
/// </summary>
public int? LabelOptionId { get; set; }

/// <summary>
/// Specifies the orientation of the barcode on the label.
///
/// Note: Perhaps this could be added to Shipper or LoadingPattern?
/// </summary>
public int? BarcodeOrientationId { get; set; }

/// <summary>
/// Specifies whether the carrier dimensions will be used for the process.
/// </summary>
public bool UseCarrierAssociations { get; set; }
}
27 replies
CC#
Created by nlohim on 1/17/2023 in #help
❔ EF inheritance, selecting from multiple children
ProcessSpec parent:
public class ProcessSpec : SpecBase
{
public ProcessSpec()
{
ProcessSpecDosimeterLoadings = new List<ProcessSpecDosimeterLoading>();
DosimeterLoads = new List<DosimeterLoad>();
}

[Key]
public int ProcessSpecId { get; set; }

[MaxLength(255)]
public string ProcessSpecName { get; set; }

public int TreatmentSystemId { get; set; }

/// <summary>
/// Describes this process spec
/// </summary>
[MaxLength(255)]
public string Description { get; set; }
}

inheritance 1:
public class ProcessSpecGamma : ProcessSpec
{
/// <summary>
/// Refers to the density (in g/cm³) of the minimum density to be used in the process.
/// </summary>
[Column(TypeName = "decimal(18,3)")]
public decimal? MinDensity { get; set; }

/// <summary>
/// Refers to the density (in g/cm³) of the maximum density to be used in the process.
/// </summary>
[Column(TypeName = "decimal(18,3)")]
public decimal? MaxDensity { get; set; }
}
ProcessSpec parent:
public class ProcessSpec : SpecBase
{
public ProcessSpec()
{
ProcessSpecDosimeterLoadings = new List<ProcessSpecDosimeterLoading>();
DosimeterLoads = new List<DosimeterLoad>();
}

[Key]
public int ProcessSpecId { get; set; }

[MaxLength(255)]
public string ProcessSpecName { get; set; }

public int TreatmentSystemId { get; set; }

/// <summary>
/// Describes this process spec
/// </summary>
[MaxLength(255)]
public string Description { get; set; }
}

inheritance 1:
public class ProcessSpecGamma : ProcessSpec
{
/// <summary>
/// Refers to the density (in g/cm³) of the minimum density to be used in the process.
/// </summary>
[Column(TypeName = "decimal(18,3)")]
public decimal? MinDensity { get; set; }

/// <summary>
/// Refers to the density (in g/cm³) of the maximum density to be used in the process.
/// </summary>
[Column(TypeName = "decimal(18,3)")]
public decimal? MaxDensity { get; set; }
}
27 replies
CC#
Created by nlohim on 1/17/2023 in #help
❔ EF inheritance, selecting from multiple children
For which?
27 replies
CC#
Created by nlohim on 1/11/2023 in #help
❔ Tabbing between Entries or Editors in a grid
Anyone? 😦
4 replies