Search results for query: *

  1. M

    why .Update duplicating a record?

    It does go to the proper if/else statements and displays what I want it to. It's just that after it hits update, it just doesn't actually update. It's actually creating a new record. Is this potentially an issue with Entity Framework?
  2. M

    why .Update duplicating a record?

    Forgive my ignorance, but why do you avoid it? What do you use instead?
  3. M

    Answered Unicode In Database Not Displaying Properly on View?

    Could that possibly be a typo? In other parts of the API, the symbols are directly in there. It's just the name that's like that. Also, yes, decoding did the job, so thank you for this! park.ParkName = HttpUtility.HtmlDecode(individualPark.FullName);
  4. M

    why .Update duplicating a record?

    Do you know why .Update would be duplicating a record? I am running the REST call to save info to my Parks database, but before I save it, I am checking the park code to see if it's already in the database. Is this even the right code? It does hit the else statement, content just doesn't get...
  5. M

    Answered Unicode In Database Not Displaying Properly on View?

    Looking back at Postman, and even that says "name": "Haleakalā"
  6. M

    Answered Unicode In Database Not Displaying Properly on View?

    I am using the National Park Service REST API to pull park info which I am saving to a SQL database. It saves with the unicode value. One of the parks in Hawai'i is Haleakalā National Park, which is fine, only whenever I want it to display, it shows exactly that unicode and not the actual...
  7. M

    Resolved Possible Issue with Registering a Service?

    private readonly IPeopleService _peopleService; public PeopleController(IPeopleService peopleService) { _peopleService = peopleService; } Sorry, copy and pasted. This is what it should be
  8. M

    Resolved Possible Issue with Registering a Service?

    Figured it out. It was a syntax thing. Error on the Controller Should have been: public PeopleController(IPeopleService _peopleService) { _peopleService = peopleService; } I was referencing the actual service, and not the interface
  9. M

    Resolved Possible Issue with Registering a Service?

    Yeah, sorry, there actually is no underscore in the parameter. So is it wrong in saying the order should be 1. Inject services in the Startup file that connects to the specific service interface and service class 2. Create a service that inherits from the interface and run the required method...
  10. M

    Resolved Possible Issue with Registering a Service?

    I am just creating services for the first time, and my application errors out whenever I try to go to the view of the controller I am working on. A Service Interface for People: public interface IPeopleService { List<Person> GetPeople(); } The Service Itself: public...
  11. M

    Resolved How to Implement DbSet and DbContext in Service-Repository Architecture?

    That makes sense. So you still have 1 service layer for each model, right? Then an additional service layer for models that share values from multiple models? Thank you so much!
  12. M

    Resolved How to Implement DbSet and DbContext in Service-Repository Architecture?

    I am updating my .NET Core web app from just MVC to a Service-Repository pattern. My question is, how do you implement DbSet<> when you add the Service and Repository layers? I originally added these to my ApplicationDbContext file under the Data folder. Is this still correct? Then would I just...
  13. M

    Question Add Items to a WishList from 2 Separate Models

    Would the better way be View Components?
  14. M

    Question Add Items to a WishList from 2 Separate Models

    ------------------------- Update: Added a new list to allow the foreach loop to enumerate through Updated Partial View: @model walkinthepark.Models.HikerParkWishlist <h3 class="text-center">National Parks Wishlist</h3> @{ // Create an empty list for the marker values to add into...
  15. M

    Question Add Items to a WishList from 2 Separate Models

    I recently created a method to add items to a wishlist. I am using Park and Hiker models, and the wishlist is created to combine values from both tables. Information is saving to the Wishlist table just fine, but I am getting an error trying to loop through each record. Park Model: public...
  16. M

    Question Add Items to a WishList from 2 Separate Models

    That did it. On my junction table: public class HikerParkWishlist { public int HikerId { get; set; } public Hiker Hiker { get; set; } public int ParkId { get; set; } public string ParkName { get; set; } public Park Park { get; set; } }...
  17. M

    Question Add Items to a WishList from 2 Separate Models

    I'm having issues trying to make a wishlist. I have a database with records of National Parks. I also have a database with records of Hikers. I have a button on the Park details view page that is supposed to redirect to an action. @Html.ActionLink("Add Park to Wish List", "AddParkToWishList"...
  18. M

    Answered How to Log Out a User After Deleting Record?

    That's actually a mistake. I will have them redirect to the main home page after deleting. I don't have roles set up yet. I've only done that with Framework. Is there an issue will allowing a registered user to delete their own record?
  19. M

    Answered How to Log Out a User After Deleting Record?

    That did it. Added to the top of my controller and constructor: private readonly SignInManager<IdentityUser> _signInManager; public PeopleController(ApplicationDbContext context, SignInManager<IdentityUser> signInManager) { _context = context; _signInManager = signInManager; } A...
  20. M

    Answered How to Log Out a User After Deleting Record?

    Perhaps. How would you go about doing that? Do you have to get the entire record you want to delete? Or maybe just the email (the part that's still showing)? public void Remove(string key) { Response.Cookies.Delete(key); } Something like that? Am I passing a single value, or a User Object?
Back
Top Bottom