Questions tagged [asp.net-mvc]

Model-View-Controller for the ASP.NET framework

Filter by
Sorted by
Tagged with
1
vote
0answers
53 views

Credit based order system

I'm implementing a system, which requires an order to be active. I have a class called Yritys, which is the customer account who would have credits. 1 credit would mean 1 day of service use. Yritys (...
0
votes
1answer
38 views

Use Request with Fileupload in Controller

I wrote a fileupload function for my application. Basically the application is a web based folder structure, which has files included. I don't know, but I am not happy with it. Is it too long? Can I ...
6
votes
3answers
3k views

Monkeying around with Survey Monkey and Asp.Net Mvc

Intro I've been a desktop dev for a long time now, and have never really had to monkey with web development until very recently. I have a need to do some custom integration with Survey Monkey's Api ...
0
votes
1answer
74 views

Generic Wrapper class for HTTPClient methods

I am trying to using HttpClient for making API calls from a different domain and for that purpose I have created the following service class after doing some research. It is 4.7.2 framework and not a ....
0
votes
0answers
39 views

Clean way for sending Google Analytics events

I am working on an e-commerce website. I want to track 2 events in Google Analytics (I would need to send these events to Analytics): when a buyers contacts a sellers (an email will be sent through ...
4
votes
2answers
689 views

Repository pattern with Unit of work using ADO.NET in C# to authenticate user from database

So I am using the latest version of Dapper and it works great for mapping my POCO classes but there are some scenarios where I need to return a DataSet instead of ...
1
vote
0answers
47 views

Addition/removal of entities in EF6 many-to-many architecture

Is there a way to do this many-to-many update with less code? It feels awfully bulky to me. I started out using AutoMapper to avoid the explicit value assignments, but then the mapped ...
2
votes
0answers
46 views

Managing invalid cookie when 2 users use the same computer and therefore share the same cookie

I have asked this question on stackoverflow... here, I am asking for some feedback on the solution that I have implemented. I am using ASP.NET MVC default template to logout user: ...
2
votes
0answers
3k views

Member management of Active Directory groups via an ASP.NET MVC website

Background One of the projects I'm working on is an Intranet website which is a front-end for several kinds of data, each aimed at a different set of users. Access to the website is handled through ...
3
votes
2answers
402 views

c# IEnumerable Update object

I have this code that I am using to update OriginalId using the Id value. I there a better way to do this then using all the loops? Controller ...
1
vote
1answer
56 views

Decoupling of validation and data access in ASP.NET

I've been asigned to a project no dev has touched in a long time. It's an ASP.NET MVC 4 application. It appeared to be well coded, but had no testing and the database migration folder is not present. ...
9
votes
3answers
540 views

Creating a round robin MySQL connection manager

Background I am working on an e-commerce website, my web server is written in ASP.NET MVC (C#, EF6) and I am using 3 instances of MySQL DB. These DBs are in a cluster (Galera Cluster) and they are ...
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
1answer
597 views

Filtering items in an ecommerce site with asp.net mvc and ajax

I'm trying to filter items from an ecommerce site.The project on the local server was running smoothly.However, I noticed significant delays since the project was published on the global server.Most ...
0
votes
1answer
45 views

Calculate 8 hours business day in a weekdays only [closed]

I am fairly new into asp.net MVC c# I am working on request holiday app where an employee can request holidays. The problem is the app works fine, however, I am trying to set 8 hours a day when an ...
3
votes
1answer
173 views

Grouping low-level services together into a high-level service

I am working on an e-commerce website. What I need to do is to save an advertisement. The ad has some properties and some photos... properties should be save to DB and photos should be saved to file ...
4
votes
1answer
377 views

Initializing entity framework context in constructor

We use the architecture shown in the code below to initialize the DB context for our MVC 5 project using entity framework 6 We have the following questions related to it: Is it safe to initialize ...
1
vote
1answer
47 views

Using nullable properties in a base class for record selection in Table per Hierarchy

I want to be able to list every Transaction associated with a Client in date order. ...
1
vote
0answers
64 views

Getting around CORS error for displaying images on my website

I have my images stored in an S3 bucket and I am serving them from AWS CloudFront. I have created 2 CNAME records for the CloudFront: mywebsite.com and ...
1
vote
1answer
113 views

ASP.NET MVC 5, EF 6 filter performance

I'm creating a filter with Linq in an ASP.NET MVC application. I was hoping I could get some tips on performance enhancements, aside from any possible performance enhancements. I have a few questions:...
8
votes
4answers
2k views

DDD Architecture for an e-commerce website (uploading images)

Problem Description I am working on an e-commerce website, when a user wants to sell a product, he would open the product page and he can upload up to 12 photos: Image Upload Process This is the ...
5
votes
1answer
2k views

N-Layer using MEF dependency injection on MVC project

I'm trying to create a "perfect" generic solution structure for MVC (5.2.3.0) projects using MEF. Currently my solution looks like this. Core layer contains generic classes that could be used in any ...
3
votes
1answer
694 views

Use SemaphoreSlim to control access to a resource

We have an existing situation in an MVC ASP.NET app where it's possible for two threads to come back asynchronously, one from an external api(the payment gateway) and one from within the browser for ...
1
vote
1answer
294 views

Creating a ModelBinder to Sanitize user input in HTML format

I have a custom model binder which takes user input in HTML format, sanitize the HTML input by removing any script or XSS threat and returns the sanitized HTML string: ...
12
votes
1answer
10k views

Unit of Work (UoW) pattern with ADO.NET

I'm trying to implement the UoW pattern using ADO.NET and this is what I've achieved so far: The IUnitOfWork Interface: ...
0
votes
1answer
81 views

Rendering an html page uploaded by a user into MVC app

I need advise whether the approach I took is the optimal one (not sure whether this is the right 'stackExchange' site). I have an MVC application, which is supposed to be able to render an HTML page ...
1
vote
1answer
112 views

Authorization using Entity Framework in ASP.NET MVC

1. Backstory I recently starting programming and I found out that Entity Framework works perfect for my small-sized applications due its simplicity. I've made my custom authorize attribute for MVC ...
1
vote
0answers
36 views

Add a folder with jstree

I read on SO and other pages that I should avoid JavascriptResult, I do not realy know why, but now I use JsonResult, because it is more common. Here is my Ajax in the cshtml: ...
1
vote
0answers
46 views

Querying connection string across solution [closed]

I have an app.config file that contains some connection strings, this is accessed on a project-by-project basis In my solution, I have the following projects: A B ...
3
votes
0answers
1k views

Controller in an ASP.NET Web API application which generates a CSV file

I have a controller in an ASP.NET Web API application which generates a CSV file. The controller looks like this: ...
3
votes
1answer
2k views

Dynamic AuthorizeAttribute with database

I want to create a AuthorizeAttribute that gets the current ActionMethod RouteData and ...
3
votes
2answers
9k views

Simple tracking online users in ASP.NET

I wrote simple online users tracking for my ASP.NET MVC project. In Global.asax I added: ...
3
votes
0answers
883 views

AJAX shopping cart with quantity +/- buttons

I'm a junior developer (couple years into it) and very new to AJAX. I'm writing an internal inventory application built on MVC and right now I'm dealing with adding and removing items to/from a cart. ...
1
vote
1answer
52 views

Making EmployeeHistory ViewModel immutable as code analysis suggested

I want to display on a view the EmployeeHistory view model sorted by elements.assignEffDateNext and I want to instantiate and ...
0
votes
0answers
1k views

Upsert with .Net Core Web API

I am using .NET Core 2.2, EF Core and C#. I have created a web API project. I was requested to do an Upsert (insert or update). The entities structure is: Movie User Rating: this is used to give a ...
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 ...
0
votes
2answers
79 views

Authorization - Create and unlock a User

I just wrote this, but I am not realy happy with that. I think there is an easier way to do this. First I am checking if a user has an ID (from a portal we are using, it is in the header). After that ...
3
votes
1answer
128 views

Instantiating View Models using a static factory

I am building an e-commerce website. I have an application layer service called SearchService. SearchService receives a search ...
2
votes
0answers
1k views

Safe implementation for extending authentication cookie with user data [closed]

After searching around and reading through articles and answers I came up with this implementation for extending the cookie for Forms Authentication. I am not sure that I did not introduce any ...
8
votes
1answer
12k views

MVC 5 & EF 6 - Repository & Unit of Work Pattern

I have been looking through Code Review on the subject of Unit of Work and Repository patterns and realised that my implementation appears to provide very similar functionality but in reverse class ...
1
vote
0answers
217 views

E-commerce site for posting advertisements

I am developing an e-commerce website in ASP.NET MVC. Users can post advertisements of different types on the site. I am using inheritance to define my Ad types, and this review is mainly about ...
1
vote
1answer
107 views

Wrapper for a sales API, with a fluent interface

I've created a simple API wrapper that I intend a few developers to utilize. I decided to follow an Fluent Interface methodology, similar to this. ...
2
votes
1answer
421 views

Displaying all application errors in a view

I'm learning ASP.NET Core with MVC pattern and I didn't find anything useful related to this argument. Actually I'm looking ...
7
votes
2answers
2k views

ViewModel creator design

I am trying to move some logic outside my controller for creating my view models for the view. I have a lot of queries to fire to make sure the complete view model is ready, so to keep my ...
4
votes
1answer
1k views

Generating absolute URIs behind a reverse proxy

In my ASP.NET MVC application there are occasions where I need to generate an absolute URI, such as when sending an email confirmation link to a user. The most straightforward approach is to use ...
2
votes
1answer
1k views

Web Service that gets data from multiple tables in a database using EF Core Database-First approach

I have never created a web service before. I followed most of this Pluralsight tutorial to give me an idea of how to create one using ASP.NET MVC along with .NET Core 2.0 and Entity Framework Core. ...
-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 ...
2
votes
1answer
182 views

Design Pattern for initializing Properties of a ViewModel which only serves a display purpose

It's a question which lies me for years on the tongue. Given a LoginViewModel: ...
0
votes
2answers
12k views

Return json to browser via MVC controller for morris chart

Program is written in .Net Framework 4. Class: ...

1
2 3 4 5