C
C#2y ago
dave1

Can someone point me in the right direction to write the following class so only the Command..

is accessible publically
public record UpsertAreaShapesCommand(
long AreaId,
List<Shapes>[] shapes
) : IRequest<Result<bool>>;

public record Shapes(
string Title,
Point[] Polygon
);

public record Point(
double X,
double Y
);
public record UpsertAreaShapesCommand(
long AreaId,
List<Shapes>[] shapes
) : IRequest<Result<bool>>;

public record Shapes(
string Title,
Point[] Polygon
);

public record Point(
double X,
double Y
);
what is the 'correct' way of writing this so Point and Shape are only accessible from that command
3 Replies
Denis
Denis2y ago
You can use nested classes/records Meaning that those point and shape records are defined within the command record You'd have to rewrite the command record to look like a typical class
dave1
dave1OP2y ago
yeah i think that's how i ended up going
Denis
Denis2y ago
If you have no more questions, consider closing this question using /close
Want results from more Discord servers?
Add your server