Questions tagged [asp.net-mvc]

Model-View-Controller for the ASP.NET framework

Filter by
Sorted by
Tagged with
2
votes
2answers
296 views

EventLogger for MVC application

I have worked on one application related for booking space and required to store activity of user into table and access from admin side. For that I have created one database entity and ...
2
votes
1answer
185 views

Apply Coupon Validation in Order

I have created a mvc application for booking space. In this for booking user can applied coupon for booking. I have implemented one coupon service and validate coupon. ...
0
votes
2answers
375 views

Common Implementation for Sending mail based on time

I have created one Background service that execute after every 5 minutes and this service used for sending email after 6 hour,24 hour and 48 hour for user booking order is not confirmed. for that i ...
1
vote
1answer
2k views

HttpClient wrapper for simple calls with optional cert

Trying to ensure each controller contains it's own httpclient. The super user can change which endpoint is called from the site and some of those endpoints do not require a certificate, but some ...
6
votes
3answers
2k views

CQS implementation with decorators

I've created a "framework" or more of a library for a CQS implementation with a few decorators. Using ASP.NET Core for the front end, I wanted an opinion about how this looks/feels. I changed the ...
1
vote
0answers
43 views

Querying a database to find notifications to comments

I have a solution what I think is not the best, and I want to make this not so expensive. I'm using MVC 5 + SignalR (hubs) + EF + UnitOfWork + Generic Repos. I have a table ...
2
votes
0answers
842 views

RESTful API combining three other APIs

I have created a RESTful API that uses three other APIs with Visual Studio 2017 in .NET Core. It is the first time I have ever programmed in .NET so I am sure the code could use a lot of improvements. ...
2
votes
2answers
3k views

Separating paging, sorting and filtering

in my ASP.NET MVC application I have a service that had a method for paging, sorting and filtering of Vehicle Makes: ...
1
vote
1answer
367 views

Calculating difference in time

In table first value I have value with datatype = Start I need to calculate difference first value - midnight Last value is ...
1
vote
1answer
55 views

A service that returns paged Products with optional filtering

In order to better understand what the code does, I've captured this screencast. Basically, I have a products page and a user can filter products. CODE Here is the ...
0
votes
3answers
2k views

Repository with ViewModel (ASP.NET MVC)

I have db table Model. Here is code: ...
3
votes
1answer
2k views

Implementing integration tests in ASP.NET core using InMemory database

I am building a web application using ASP.NET core. Most of the tests in my application are unit tests, so I mocked every dependencies in order to have fast unit tests. On the other hand I am of the ...
4
votes
0answers
4k views

Logging in ASP.Net MVC project

I want to implement a Logger and use Serilog as Provider. My Project is ASP.NET MVC Framework (not core). Initially I tried to replicate ASP.Net Core Logging framework. I created a ...
0
votes
1answer
2k views

use Identity value in entity after insert in Database [closed]

i want to generate value using current date and ID of inserted entity problem is that ID value not generated until insert object to database, so i use this code for generate value: ...
0
votes
1answer
202 views

Validating a Domain or Service Method [closed]

I'm trying to determine at which level I should validate a method on my class. In my class method I throw an exception if it ever gets to that point. In my service layer I do some validation and ...
2
votes
2answers
4k views

MVC simple Employee table with paging using SP

I am a beginner web developer and I have to do an exercise to show an Employee table using a WCF service, 10 entries at a time, with the paging of the table controlled by a stored procedure. What I ...
1
vote
0answers
57 views

Volume control with using asp mvc 6

General purpose of this training project is to control sound volume on remote machine (which exposes ISystemControlClient through web service). It's created using ...
1
vote
0answers
67 views

Get typed results for examine indexer using Umbraco

Continuing on this question on Stack Overflow, I've found a working solution. The case The case I'll create is that I've got a lot of persons and a knows person get 0, 1 or multiple languages. The ...
1
vote
1answer
163 views

Performance concerns for synchronous action methods

I have an ASP.NET MVC 5 application using Entity Framework with SQL Server 2016. The application is mainly basic CRUD. The boilerplate generated when creating the project in Visual Studio did not have ...
4
votes
2answers
21k views

Creating a list with nested lists

I have made algorithms to create a list with nested lists in order to then show them in a tree view. From what users told me, my view method is fine, but the way I create the final list is probably ...
7
votes
2answers
988 views

Validation for a CQS system that throws an exception

I've been reading that exceptions should only be for something "exceptional" and not used to control the flow of a program. However, with a CQS implementation, this seems impossible unless I start ...
4
votes
2answers
8k views

Handing “Others” option in dropdown in ASP.Net MVC 5

Business Logic I have a company referral form, and in that form I have dropdown to select from a company list. But when a company is not found in the dropdown, the user can select option as "others", ...
3
votes
2answers
2k views

Using Alertify to show messages

I use a JavaScript library called Alertify to show simple, pretty messages, like "note created", or whatever. Often I want to send the user to a new page and then show an Alertify message. I'm ...
3
votes
1answer
14k views

Display a dropdown based on another dropdown change

I have a dropdown and when that dropdown changes I want to display/render another dropdown. Can someone help me improve it? So, a person requests for getting referred in a company for a job. When ...
3
votes
2answers
3k views

Using attributes with properties in asp.net MVC

I have an auto generated partial class in my Model folder with lots of properties and I need to modify some of the setters in these properties(annotate property), to ensure that I don't repeat myself ...
2
votes
1answer
2k views

Entity Framework - Table structure, navigating many descendants, etc

Someone suggested to try asking this here instead of stackoverflow, so I'm taking their advice. So I'm rewriting a dated application and trying to structure things the right way. I have a Category > ...
1
vote
1answer
37 views

Dual rewrite rules (WWW prefix and HTTPS)

I want to configure my website to force a www. prefix on the name, and the HTTPS protocol. ...
4
votes
2answers
3k views

Log Visitor Count in Asp.net MVC

I have a table to Log visitor Count Like : ...
1
vote
2answers
5k views

Async ASP.NET MVC 5 controller method

I'm attempting to correctly convert a synchronous controller method to asynchronous, given that the operation it performs is CPU-intensive. ...
4
votes
1answer
121 views

Read project setting in asp.net mvc

I have a Table that I store All setting in that , it is like below : ...
1
vote
0answers
48 views

Add Colour Tags on Click - Version 2

I recently asked a question here, where I was trying to implement some extra functionality into the tag-it plugin, where the user should be able to add tags to the input by clicking on them in a "...
2
votes
1answer
79 views

Add colour tags on click

I have implemented some extra functionality for the tag-it JavaScript plugin, where I need an option where availableTags are displayed in one box, and the user can ...
1
vote
1answer
1k views

Counting matching rows in IQueryable

I'm designing a basic ticketing system using ASP.NET MVC with Entity Framework. I'm passing a DbSet<TicketModel> into a method as an ...
2
votes
1answer
1k views

Retrieving values from Entity Framework DbContext to render in a ListBox

I need to pass a ViewModel to a strongly typed View which will display a multiple-select box using Html.ListBoxFor. My ViewModel has a ...
1
vote
1answer
2k views

MVC OnActionExecuted - session cookie - expire after x minutes of inactivity

first time poster here. I'm creating a session cookie which should expire after 30 minutes of user inactivity. I've added the following code to the base controllers OnActionExecuted method. ...
6
votes
1answer
518 views

Unit test for a CreateUser() method using JustMock lite

I'm new to unit testing and have created a unit test for a create user action method and it's passing the test. I'm not sure if this is the right way to unit test a create method. This is my test ...
1
vote
0answers
1k views

Asset management system

I'm relatively new to developing and I'm mostly self taught so a lot of what I know simply comes from googling & figuring things out from there! That being said I've put together an ASP MVC ...
2
votes
1answer
43 views

Code allowed to test mail invitations by users (from another post) on an instance of Visual studio debugging

I am currently working on an application in ASP.Net MVC, with a SQL Server 2016 database and Entity Framework 6. The application can process specific data and generate forms (in DOC format), and in ...
4
votes
1answer
583 views

Wrappers For Performing SQL Transactions

I am trying to make my ASP.NET MVC application use transactions for all database operations, to ensure safety when there are multiple users. To do this, I have created static methods in my ...
4
votes
1answer
1k views

Refactoring ViewModel and mapping from multiple sources

I need to refactor and tidy the following controller below, it's my first MVC application. I've successfully used AutoMapper as I began refactor controllers but I am not sure how to approach a ...
-1
votes
1answer
4k views

ASP.NET MVC multi language website

What is the best way to make an ASP.NET MVC multi language website? The following code is what I use, but I need to make sure from your real-world experience that my code is the best way for ...
3
votes
1answer
335 views

Save model to database

I recently asked a question on Software Engineering and I had a comment: The updated version has some issues which are out of topic here. You may consider posting it at codereview.stackexchange.com ...
6
votes
2answers
7k views

“Forgot password” functionality

I want to implement the "forgot password" functionality in Asp.Net MVC 5. Here is the code flow: Take user email ID Let the user enter the token received in his email inbox If the token matches then ...
3
votes
2answers
295 views

linq.Any() check on large database

Is there a way to speed up the Linq.Any check or perform the check in another way to enhance performance. I have a mastercodes table that records unique codes for a campaign. The code below will ...
2
votes
1answer
65 views

Get a grouped list with relational data

I am new to C# and am leaning ASP.NET MVC and Entity Framework and I am trying to create an application where a user can manager Job Postings and Applicants where an Applicant can apply for many Jobs. ...
6
votes
1answer
6k views

Update URL with new parameter value in controller action

I have an action that takes an id as a parameter and gets the corresponding item with the help of a web service. The web service's method that returns the item will either return the item with the ...
2
votes
2answers
3k views

PagedList with large data sets

I'm using X.PagedList for paging functionality in my application. The code I have works fine but when I return larger sets of data it seems like it could be faster. Is there anything I can do to my ...
2
votes
1answer
4k views

HttpClient Wrapper supports ignoring invalid/self-signed certs

I'm using the following as a wrapper for the HtptClient because it doesn't implement an interface -- which makes mocking more difficult. This logic also supports invalid and self-signed certs. ...
3
votes
2answers
410 views

Cloudinary upload call takes too long

I have the following async ActionResult. ...
1
vote
2answers
95 views

Search menu with multiple options

...