csharp

  1. Sajo

    Why I should sort elements before using foreach loop in c# ?

    Hello. I read somewhere that before using foreach loop for list elements it is necessary to use the List.Sort method to sort them before using foreach. For example, to print the elements of a list, we need to use this method first, and then the foreach cycle. My question is: why do we have to...
  2. V

    Question Report generation for an api

    Hello Community, I want to get some details from an api. I have called the api and received the response in json format. However, all details are not shown correctly. I need help around this. The result generates values in duplicate and also all results are not getting. All I am doing this for...
  3. Sajo

    Resolved How to find the smallest element in a matrix and the row in which that element is located?

    Hello everybody. I have problem with the task. The task is:" Write a C # program that loads the value of manufactured goods in m manufacturing sectors from users over n months and then determines and prints the month in which productivity was lowest." I realized that productivity is lowest in...
  4. Sajo

    How to calculate determinant of n x n matrix?

    Hello everybody. I create n x n matrix where I must calculate determinant but I don´t know how. Please can you help me? Here is code of my matrix Console.WriteLine("Enter number of rows and columns in your matrix"); int n = int.Parse(Console.ReadLine()); int[,] l = new int[n, n]...
  5. Sriram

    Answered What are all the possible scenario to write nunit test cases for login page

    I don't have idea about unit testing, what are all the possible scenario for test case to be written for a asp.net web application- login page
  6. Sajo

    Resolved Problem with verbatim string

    Hello everybody! I have a problem with verbatim string. I want to write this "c:\\projects\\project1\\enter" I use verbatim string for that. But when I run console it always display me c:\projects\project1\enter. I want to write code which is easier to read. I want double backslash not just one...
  7. D

    I need a c# mentor

    I am really trying to learn c# from Codecademy and I want to start building mobile apps with it. I have gotten to some stage where I understand some things but I really do need a mentor I can always talk to when I have a problem. At the moment, I don’t know what next to do from Codecademy...
  8. 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...
  9. octola

    Use of Microsoft.Office.Interop.Outlook

    Hello, Is it possible to retrieve the structure tree of Outlook (I mean to know which files there are, which subfolders, etc....) ? I don't find clear documentation about how to use the namespace Microsoft.Office.Interop.Outlook. Does someone have some informations ? Sorry for my english
  10. 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...
  11. 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 {...
  12. 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...
  13. 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.
  14. A

    Question What is wrong on function ExecuteNonQuery to work as Best Practise ?

    I work on c# app I need to make function make insert data or update or delete dynamically so that I do function below for insert or update or delete but I don't know what must added or remove from function below to make function work as best practice . public static async Task<int>...
  15. A

    Question How to create excel sheet with multiple sheet name based on modules ?

    I work on c# desktop app I cannot export data to excel sheet with multiple tab meaning multi sheet based on data exist on data table module field I use open XML library Data table data as below : Divide Output Excel File To Multi Tab based On Module PartId Company Files Tab Module 1222...
  16. 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...
  17. I

    Is "sealed" necessary and when?

    Hi, everybody. This operator is used so that it cannot be inherited from the class. But in the example of Unity, they had the Application class "sealed", and then in the new versions they just made the class Application. As I understand it, they did so that they could extend the Application...
  18. F

    Question Parallel class to modify flickrviewer app

    You are asked to use Parallel class to modify FlickrViewer app by adding image resizing functionality. More specifically, resize found image(s) and save these resized image locally. You can find the details about how to resize the image from Basic Image Manipulation in C# Here is the link to...
  19. Duvyanshu

    Answered Why am I unable to locate font files(.ttf) in unity android game in persistentDataPath?

    Can somebody guide me in the right direction? My android game that I made on unity 2018.4.9 using C# on VS 2017 is unable to detect files at persistent data path. The two font files are located in the persistent data path directory. This is a screenshot of app persistent data folder. This is...
  20. T

    Debug-Only Code Without Duplication

    I'm trying to write something similar to the existing Debug class that allows clients to explicitly verify pre- and post-conditions of their methods. For example, to check a precondition that the input variable to a method is not equal to 0, one would use Expects.IsGreaterThan(input, 0), and...
Back
Top Bottom