Search results for query: *

  1. 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...
  2. 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...
  3. 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...
  4. 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...
  5. 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"...
  6. M

    Answered How to Log Out a User After Deleting Record?

    Having issues logging out after deleting a user I have 2 tables: dbo.AspNetUsers dbo.People I have an ActionLink on the Person Details View that passes the ID: @Html.ActionLink("Delete Profile", "Delete", "Hiker", new { id = Model.Id }, new { @class = "btn btn-danger" }) Then, I'm going to a...
  7. M

    Question Proper Folder Structure

    This might be too broad of a topic, but how are you supposed to set up a file structure when using .NET Core MVC. When creating a new project, you are given the following: >>Dependencies >>Properties >>wwwroot >>Areas >>Controllers >>Data >>Models >>Services >>Views >>appsettings.json...
  8. M

    Question How to Foreach Through ViewModels?

    How do you use a ForEach loop on ViewModels on .NET MVC? I have 2 models: A Park Model: public class Park { [Key] public int ParkId { get; set; } public string ParkName { get; set; } public string ParkState { get; set; } public string ParkLatitude {...
  9. M

    Resolved SqlException: Cannot insert explicit value for identity column

    How do you populate a database with multiple records from a REST API call? I'm trying to populate information from a REST API into my MS SQL database. I'm actually rebuilding on .NET Core from an original Framework project. Using the National Park Service REST endpoint. public async Task...
  10. M

    Proper way to call a method on button click

    I want to fetch a REST API endpoint, but I want to do it on button click. Is there a proper way to do this? I'm using the following: ``` <input type="button" value="Fetch Parks" onclick="location.href='@Url.Action("FetchParkApi", "Park")'" /> ``` which is a button that's meant to run a method...
  11. M

    MVC to MRC (Model Razor Controller)?

    I've been trying to learn .NET Core after first learning the Framework structure. I am still learning regular views, which utilize Razor code, but I'm coming across a lot of Razor page info. Is it now, or will it ever be a structure of Models, Razor Pages, and Controllers? -A curious learner.
  12. M

    Answered Publish .NET Framework on Azure Still Possible?

    I've been trying to launch a .NET Framework web application to Azure, and I can't seem to get it. Every tutorial out there is using, or pushing .NET Core. This is a basic application using C#, .NET Framework 4.7.2 MVC, and connecting to some REST APIs. 1. When deploying .NET Framework app, do...
  13. M

    How to Code User-Typed Console info with SOLID Principles

    I recently completed an small assessment that reads a CSV sheet, then adds to it. This is a C# console app. I'm still learning, and at this point, I can achieve MVP, but it is lacking in SOLID principles or 4 pillars of OOP. Here is a working method for retrieving a first name from a user...
Back
Top Bottom