Theme Parks and Rides (Entity Framework 6) C# [closed]Enabling discard pending changes on DbContextCode First...
Open a doc from terminal, but not by its name
Does Doodling or Improvising on the Piano Have Any Benefits?
Does an advisor owe his/her student anything? Will an advisor keep a PhD student only out of pity?
What is going on with 'gets(stdin)' on the site coderbyte?
What should you do if you miss a job interview (deliberately)?
What does routing an IP address mean?
If magnesium reacts with oxygen to produce magnesium oxide only on the application of heat, then why isn't it categorised as an endothermic reaction?
Removing files under particular conditions (number of files, file age)
What percentage of fillings performed today are done with mercury amalgam?
Python scanner for the first free port in a range
How much character growth crosses the line into breaking the character
When were female captains banned from Starfleet?
Infinite dials to reset ever?
What should you do when eye contact makes your subordinate uncomfortable?
Is it improper etiquette to ask your opponent what his/her rating is before the game?
The IT department bottlenecks progress. How should I handle this?
Electoral considerations aside, what are potential benefits, for the US, of policy changes proposed by the tweet recognizing Golan annexation?
Is preaching recommended or mandatory to a temple priest?
How should I respond when I lied about my education and the company finds out through background check?
Are paving bricks differently sized for sand bedding vs mortar bedding?
Why Shazam when there is already Superman?
Freedom of speech and where it applies
Is there any references on the tensor product of presentable (1-)categories?
Are Captain Marvel's powers affected by Thanos' actions in Infinity War
Theme Parks and Rides (Entity Framework 6) C# [closed]
Enabling discard pending changes on DbContextCode First Entity FrameworkDatabase first entity framework, repository, service, UnitOfWork patternSeperating Entity Framework into BLLComponentManager - Entity-Component-System architecture in C++Retrieving Primary Key from Entity Framework entityWriting to a newly created file, with support for unit testingCloning Entity Framework entitiesEntity Framework configurationSetting Entity Framework up for success
$begingroup$
Preface
This application is something I am doing as a personal practice project that relates to theme parks and rides.
Basically, we first have one of the objects that represents something I would take out of the database. This class is as follows:
public class Parks
{
public int Id { get; }
public string ParkValue{ get; set; }
public string ParkName { get; set; }
}
Simple class, with 3 properties. Now, here is the data access that builds this based on an Id
which comes from a different portion of the application.
public class ParkDataRetriever
{
public Parks GetSelectedPark(Parks Park, int Id)
{
using (var Db = new MyContext())
{
List<ParkList> ListOfParks = Db.ParkLists.Where(x => x.ParkId == Id).ToList();
var Parks = ListOfParks.Single();
Parks.ParkId = Park.Id;
Parks.ParkName = Park.ParkName;
Parks.DomValue = Park.DomValue;
return Park;
}
}
}
So then in the application, we now have a type of class Parks that we can now use in the application.
Questions
Is this testable or is it too tightly coupled because of the using (var Db = new MyContext())
?
For the sake of practice, I would want to pretend as if this was an application that would one day scale in size. So I imagine the more decoupled, the better off I am.
c# entity-framework
$endgroup$
closed as unclear what you're asking by πάντα ῥεῖ, yuri, Zeta, t3chb0t, Vogel612♦ Mar 16 at 14:27
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
add a comment |
$begingroup$
Preface
This application is something I am doing as a personal practice project that relates to theme parks and rides.
Basically, we first have one of the objects that represents something I would take out of the database. This class is as follows:
public class Parks
{
public int Id { get; }
public string ParkValue{ get; set; }
public string ParkName { get; set; }
}
Simple class, with 3 properties. Now, here is the data access that builds this based on an Id
which comes from a different portion of the application.
public class ParkDataRetriever
{
public Parks GetSelectedPark(Parks Park, int Id)
{
using (var Db = new MyContext())
{
List<ParkList> ListOfParks = Db.ParkLists.Where(x => x.ParkId == Id).ToList();
var Parks = ListOfParks.Single();
Parks.ParkId = Park.Id;
Parks.ParkName = Park.ParkName;
Parks.DomValue = Park.DomValue;
return Park;
}
}
}
So then in the application, we now have a type of class Parks that we can now use in the application.
Questions
Is this testable or is it too tightly coupled because of the using (var Db = new MyContext())
?
For the sake of practice, I would want to pretend as if this was an application that would one day scale in size. So I imagine the more decoupled, the better off I am.
c# entity-framework
$endgroup$
closed as unclear what you're asking by πάντα ῥεῖ, yuri, Zeta, t3chb0t, Vogel612♦ Mar 16 at 14:27
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
1
$begingroup$
If we should look past the loop then there is virtually nothing left to review. You need to post some real code that makes sense.
$endgroup$
– t3chb0t
Mar 16 at 9:52
$begingroup$
@t3chb0t I guess I could just return single instead of doing the .toList(). I’m not really sure what difference it would make to remove the loop and just assign each property from a single result. I think the question still remains the same, cause are the property assignments really where tight coupling would take place, if it existed?
$endgroup$
– CMR
Mar 16 at 12:56
add a comment |
$begingroup$
Preface
This application is something I am doing as a personal practice project that relates to theme parks and rides.
Basically, we first have one of the objects that represents something I would take out of the database. This class is as follows:
public class Parks
{
public int Id { get; }
public string ParkValue{ get; set; }
public string ParkName { get; set; }
}
Simple class, with 3 properties. Now, here is the data access that builds this based on an Id
which comes from a different portion of the application.
public class ParkDataRetriever
{
public Parks GetSelectedPark(Parks Park, int Id)
{
using (var Db = new MyContext())
{
List<ParkList> ListOfParks = Db.ParkLists.Where(x => x.ParkId == Id).ToList();
var Parks = ListOfParks.Single();
Parks.ParkId = Park.Id;
Parks.ParkName = Park.ParkName;
Parks.DomValue = Park.DomValue;
return Park;
}
}
}
So then in the application, we now have a type of class Parks that we can now use in the application.
Questions
Is this testable or is it too tightly coupled because of the using (var Db = new MyContext())
?
For the sake of practice, I would want to pretend as if this was an application that would one day scale in size. So I imagine the more decoupled, the better off I am.
c# entity-framework
$endgroup$
Preface
This application is something I am doing as a personal practice project that relates to theme parks and rides.
Basically, we first have one of the objects that represents something I would take out of the database. This class is as follows:
public class Parks
{
public int Id { get; }
public string ParkValue{ get; set; }
public string ParkName { get; set; }
}
Simple class, with 3 properties. Now, here is the data access that builds this based on an Id
which comes from a different portion of the application.
public class ParkDataRetriever
{
public Parks GetSelectedPark(Parks Park, int Id)
{
using (var Db = new MyContext())
{
List<ParkList> ListOfParks = Db.ParkLists.Where(x => x.ParkId == Id).ToList();
var Parks = ListOfParks.Single();
Parks.ParkId = Park.Id;
Parks.ParkName = Park.ParkName;
Parks.DomValue = Park.DomValue;
return Park;
}
}
}
So then in the application, we now have a type of class Parks that we can now use in the application.
Questions
Is this testable or is it too tightly coupled because of the using (var Db = new MyContext())
?
For the sake of practice, I would want to pretend as if this was an application that would one day scale in size. So I imagine the more decoupled, the better off I am.
c# entity-framework
c# entity-framework
edited Mar 17 at 20:55
CMR
asked Mar 16 at 1:11
CMRCMR
41
41
closed as unclear what you're asking by πάντα ῥεῖ, yuri, Zeta, t3chb0t, Vogel612♦ Mar 16 at 14:27
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
closed as unclear what you're asking by πάντα ῥεῖ, yuri, Zeta, t3chb0t, Vogel612♦ Mar 16 at 14:27
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
1
$begingroup$
If we should look past the loop then there is virtually nothing left to review. You need to post some real code that makes sense.
$endgroup$
– t3chb0t
Mar 16 at 9:52
$begingroup$
@t3chb0t I guess I could just return single instead of doing the .toList(). I’m not really sure what difference it would make to remove the loop and just assign each property from a single result. I think the question still remains the same, cause are the property assignments really where tight coupling would take place, if it existed?
$endgroup$
– CMR
Mar 16 at 12:56
add a comment |
1
$begingroup$
If we should look past the loop then there is virtually nothing left to review. You need to post some real code that makes sense.
$endgroup$
– t3chb0t
Mar 16 at 9:52
$begingroup$
@t3chb0t I guess I could just return single instead of doing the .toList(). I’m not really sure what difference it would make to remove the loop and just assign each property from a single result. I think the question still remains the same, cause are the property assignments really where tight coupling would take place, if it existed?
$endgroup$
– CMR
Mar 16 at 12:56
1
1
$begingroup$
If we should look past the loop then there is virtually nothing left to review. You need to post some real code that makes sense.
$endgroup$
– t3chb0t
Mar 16 at 9:52
$begingroup$
If we should look past the loop then there is virtually nothing left to review. You need to post some real code that makes sense.
$endgroup$
– t3chb0t
Mar 16 at 9:52
$begingroup$
@t3chb0t I guess I could just return single instead of doing the .toList(). I’m not really sure what difference it would make to remove the loop and just assign each property from a single result. I think the question still remains the same, cause are the property assignments really where tight coupling would take place, if it existed?
$endgroup$
– CMR
Mar 16 at 12:56
$begingroup$
@t3chb0t I guess I could just return single instead of doing the .toList(). I’m not really sure what difference it would make to remove the loop and just assign each property from a single result. I think the question still remains the same, cause are the property assignments really where tight coupling would take place, if it existed?
$endgroup$
– CMR
Mar 16 at 12:56
add a comment |
0
active
oldest
votes
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
1
$begingroup$
If we should look past the loop then there is virtually nothing left to review. You need to post some real code that makes sense.
$endgroup$
– t3chb0t
Mar 16 at 9:52
$begingroup$
@t3chb0t I guess I could just return single instead of doing the .toList(). I’m not really sure what difference it would make to remove the loop and just assign each property from a single result. I think the question still remains the same, cause are the property assignments really where tight coupling would take place, if it existed?
$endgroup$
– CMR
Mar 16 at 12:56