New answers tagged

3

This implementation is quite from a production-ready CRUD API. Just to name a few missing things: Presentation and Persistence layer separation Controller should deal with HTTP related stuff, not with databases Proper status code handling (see the next section for more details) Model validation Error handling for example: what if database is not ...


3

ExpressionParser is too general, you might need to renamed it to be specific such as MathExpressionParser. ExpressionParser should be abstract class along with Variables property. Computer in ExpressionParser can be declared globally, and used across the class. in the Compute method, you're not validating the string, you should add some validations such ...


5

I can see three small improvement areas: Use ctor instead of object initializer Instead of this: new DataColumn(v.Key) { DataType = v.Value.GetType() } Use this: new DataColumn(v.Key, v.Value.GetType()) Object initializer will run after ctor. If ctor accepts that parameter then prefer to provide it in the ctor. Use early exist instead of guard expression ...


2

I think it can be something like this, also it can be improved by using variable names that reflects your business conditions better. private void UpdateAccount(UserModel userData) { Account accountById = _accountController.GetAccountById(userData.Id); Account accountByNumber = _accountController.GetAccountByNumber(userData.Number); ...


Top 50 recent answers are included