Search results for query: *

  1. S

    Deciding the best approach to refactor some code

    I managed to sort it :)
  2. S

    Deciding the best approach to refactor some code

    Think ill go with the mapping between the two: private IDictionary<PaymentScheme, AllowedPaymentSchemes> MappingEnums = new Dictionary<PaymentScheme, AllowedPaymentSchemes> { { PaymentScheme.FasterPayments, AllowedPaymentSchemes.FasterPayments }, {...
  3. S

    Deciding the best approach to refactor some code

    The values are different: public enum PaymentScheme { FasterPayments, Bacs, Chaps } public enum AllowedPaymentSchemes { FasterPayments = 1 << 0, Bacs = 1 << 1, Chaps = 1 << 2 }
  4. S

    Deciding the best approach to refactor some code

    :ROFLMAO: Just one more thing mate, here we are referring to an enum when using the HasFlag method: !accountRetrieved.AllowedPaymentSchemes.HasFlag(AllowedPaymentSchemes.Chaps) !accountRetrieved.AllowedPaymentSchemes.HasFlag(AllowedPaymentSchemes.FasterPayments) The class is here: public...
  5. S

    Deciding the best approach to refactor some code

    Nice! the only thing which I don't get here, is how come you haven't made use of the Enum "AllowedPaymentScheme" Secondly would using the ?? operator become the same condition here: var success = account?.AllowedPaymentSchemes.HasFlag(request.PaymentScheme) ?? false;
  6. S

    Deciding the best approach to refactor some code

    sorry I meant true** there is an if statement after which then makes the payment if(Payment.Success) { /// account updated }
  7. S

    Deciding the best approach to refactor some code

    public class MakePaymentResult { public bool Success { get; set; } } } This is what its referring to in the solution, the default value isnt specified, but if none of the conditions are correct im guessing it would be true. below is the original code: var result = new...
  8. S

    Deciding the best approach to refactor some code

    Hi, I'm working on a test and I'm trying to find the best way to refactor the code below. Each case is an Enum and returns a boolean switch (request.PaymentScheme) { case PaymentScheme.Bacs: if (accountRetrieved == null ||...
  9. S

    Getting an error when launching my virtual assistant application

    Hi, I've recently set up a virtual assistant in visual studio and when running the program, it gives me the following error: "LuisService.Region cannot be Null" I'm completely new to Azure so I'm not entirely sure what this means. Can anyone help? I've attached an image to give you more...
  10. S

    How to set up a chatbot?

    I want to get my chatbot up and running asap, so i can start playing around with it/creating simple dialogue systems etc. I want to have something which can build on overtime and in the end have a sophisticated conversational AI. On another forum they suggested that I use the virtual assistant...
  11. S

    What would I need to use if I'm looking to create a conversational AI?

    Okay thanks @Skydiver ill check that out ? I’m thinking of putting the chat on my own website as that will allow me to learn more skills in C#. After university I’ll want to create my own portfolio, so learning Asp.net would be really beneficial to me later on.
  12. S

    What would I need to use if I'm looking to create a conversational AI?

    For my final year project I've decided to create a chatbot about mental health i.e. depression and anxiety. I’ll be working on it from the end of this month until the start of September. My question is what would be the best way to implement this? Baring in mind this would be about mental...
  13. S

    Need some ideas for my final project

    hmm that sounds really interesting actually, I'll take a look into that. The module I'm doing split into two parts, first we have to carry out relevant research on the topic that we would like to cover and then finally produce the program using c#. I want to do something that's not too common...
  14. S

    Need some ideas for my final project

    I’m studying a masters in computing systems and I’m at that point now where I need to start planning what I’m going to do for my final project. During the course I’ve created two programs using .net framework. The first one was a medical related application where I managed data through JSON...
  15. S

    Hi guys just have a question regarding parameterized queries.

    Ah yes, I've been meaning to change that, I'll look into that now (y)
  16. S

    Hi guys just have a question regarding parameterized queries.

    Yeah I'm pretty confident that there are no issues with any of the queries, I've tested them numerous times and they all work as intended. I was just a bit concerned when i was given that comment yesterday, made me panic :LOL:
  17. S

    Hi guys just have a question regarding parameterized queries.

    Initially I was concatenating my SQL queries, i was then informed that it would be best to use parameterized queries to prevent SQL Injection. I've now done that and everything works fine, however when posting on a forum yesterday about one of my queries not working properly, a person told me...
  18. S

    Resolved Accessing an individual value within a list

    damn I'm sorry, I've literally just woke up and read your post wrong :rolleyes: noted for next time.(y) I will only be storing the data from one customer in the list (This will be the customer that sign's in). Its a college project I'm doing for a booking system, just a model which allows a...
  19. S

    Storing values from a single column within a list.

    I would like to read all of the values from the column name "seatNo" and store those values within a list. I've done most of the code but i have absolutely no idea how to actually store the values Here is what i have so far: private List<string> seatNumbers = new List<string>()...
Back
Top Bottom