Search results

  1. Skydiver

    Move my parameters inside my array list with my string text

    I wonder if the creation of the array list was to try to make the code more legible. Here's my various attempts to try to see which one is the most legible. public static class SqlParametersExtensions { public static IEnumerable<SqlParameter> ToSqlParameters(this IDictionary<string, object>...
  2. Skydiver

    Move my parameters inside my array list with my string text

    Ah. Then do this: public static IEnumerable<SqlParameter> BriefingForSmartPeople(string Msg, string Time) { yield return new SqlParameter("@hello", Msg); yield return new SqlParameter("@time", Time); } public static IEnumerable BriefingForMyDumbTeacher(string Msg, string Time) =>...
  3. Skydiver

    Move my parameters inside my array list with my string text

    Perhaps I am missing something. Why even use the intermediate ArrayList when the return type of Briefing() is an IEnumerable? Why not simply have: public IEnumerable Briefing(string Msg, string Time) { yield return new SqlParameter("@hello", Msg); yield return new SqlParameter("@time"...
  4. Skydiver

    Queueing Machine with arduino thermal printer and GSM module ..

    On Windows yes. This not like the days of DOS when each program had to carry around it's own printer drivers and so it became an arms race among the word processors and desktop publishing apps over who supported the most printers.
  5. Skydiver

    Answered Using path.GetFullPath to return local directory?

    Or the C# way of doing the same as the VB linked to above... https://docs.microsoft.com/en-us/dotnet/api/system.environment.getfolderpath?view=netframework-4.8
  6. Skydiver

    Resolved Adding web page to asp.net web API

    Perhaps I am missing something. It's a Web API. It is not meant to be used interactively. Why would you want to add an interactive Web UI?
  7. Skydiver

    Question What is the difference between CustomExceptionFilter and GlobalExceptionHandler?

    Did you look at this blog post? Exception Handling in ASP.NET Web API - A Guided Tour
  8. Skydiver

    Question List of objects - how to remove duplicates?

    Just use the Distinct<T>() extension method. Here would be a naive implementation. class ReconDetailComparer : IEqualityComparer<ReconDetail> { public bool Equals(ReconDetail a, ReconDetail b) => a.referenceId == b.referenceId; public int GetHashCode(ReconDetail a) =>...
  9. Skydiver

    Question NLog logging

    What I am trying to say is that you can use similar tags/placeholders for your text file as well. For example, you have this code to stick in the current time stamp, logger.Error(strLogText + Environment.NewLine + DateTime.Now); but NLog already has a tag/placeholder for "${date} and ${time}"
  10. Skydiver

    Question NLog logging

    Perhaps I'm missing it, but since NLog support all kinds of magic templates to layout how your log output looks like, why do you still have all that extra code to do all the formatting? Also, NLog, like most logging libraries worth their salt, supports more than just logging errors. Some well...
  11. Skydiver

    Date Formats using Methods

    Okay. So what have you done so far? What you have thought about and/or investigated? Or are you just expecting people here to do your homework for you?
  12. Skydiver

    Question Why not errors written to DB?

    While you try to figure that out, I recommend also reading the series of blog posts here: Unity lifetime management for IDisposable, part 1 Unity lifetime management for IDisposable, part 2 Unity lifetime management for IDisposable, part 3 The first part also highlights the same problem I...
  13. Skydiver

    Question Why not errors written to DB?

    Is your UnitOfWork still the same as the one you presented in your other thread? Can I correctly assume that the GameContext is simply a subclass of the Entity Framework DbContext? If so, when is the UnitOfWork being disposed? Is the GameContext that is injected into the UnitOfWork disposed...
  14. Skydiver

    How to copy an image from App to external storage Unity Android?

    Since your sprite is presumably already an array of bytes, why not just use the same code you pasted above for Write() but instead of converting the newData to JSON, and then from JSON to bytes, just save you byte data directly?
  15. Skydiver

    Question Why not errors written to DB?

    Since you don't show us the bodies of the methods you call within that if block, it's kind of hard to tell. How do we know if they are implemented correctly or not? Also, with those await keywords there and not knowing what context your async method is being called, how will we know if any...
  16. Skydiver

    Queueing Machine with arduino thermal printer and GSM module ..

    If the printer uses a regular Windows driver or even the generic Windows Plain Text printer driver, then just follow Petzold's chapter in Programming Windows (5th or 6th edition) regarding printing. On Windows as long as you have the correct print driver, the printing code is always the same...
  17. Skydiver

    Question Player Movement script in Unity not working

    In the future, please put your code in CODE tags. It will make it much easier for other people coming to the forum to read. Anyway, can you describe "not working". Is the script failing to load or compile? Is the script successfully being loaded and run, but you are not seeing the results you...
  18. Skydiver

    Question Why not errors written to DB?

    "The remote name could not be resolved: 'test.com'" would be indicative on a DNS issue.
  19. Skydiver

    Question Why not errors written to DB?

    I hate those "Fixed by magic" issues, especially when the network or machine admin claims they didn't change anything (but the session logs show that they were logged on to the machine for some reason).
  20. Skydiver

    Question Why not errors written to DB?

    That HttpClient on post #33 is an outbound HTTP client connection. The errors logged by IIS in HTTPERR logs are for inbound connections.
Top Bottom