Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7868811
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T01:07:08+00:00 2026-06-03T01:07:08+00:00

I have a file uploading logic and a very specific business rules. And according

  • 0

I have a file uploading logic and a very specific business rules. And according them I should parse my filemodel to row, which looks like “Header:{processed field1},{processed field2},{processed field3},{processed field4},{processed field5},{processed field6},{processed field7},{processed field8} and so on for 19 params” It’s initially custom serialization.

And I also should have possibility to parse this row back to object. So, the question is what is a common idea to codding such staff?

Because now for parsing model to row I just use string.format with many options, and for parsing row to model I split the row by ‘,’ and then manipulation with parts of information assign it to models fields. But in this implementation there are a lot of low level work, some hard coded position and also a lot of things that do not look pretty for me.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T01:07:09+00:00Added an answer on June 3, 2026 at 1:07 am

    You should put your serialization / deserialization inside a custom serializer. You can follow the same pattern as the other serializers in the .net library and implement the IFormatter interface . This would provide you with a common interface that you can use to stream to and from a file (or any stream):

    using (var fileStream = new FileStream(fileName, FileMode.Create))
    {
        var formatter = new CustomFormatter();
        formatter.Serialize(fileStream, objectToSerialize);
    }
    
    using (var fileStream = new FileStream(fileName, FileMode.Read))
    {
        var formatter = new CustomFormatter();
        return (CustomType)formatter.DeSerialize(fileStream);
    }
    

    You can see an example of a custom formatter in this download

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a html form for uploading a file, which is as follows: $uploadhtml
I have a Cancel button which appears when the user is uploading a file.
I have 2 files namely: uploading.php emaillinks.php both include a file inc.php which has
I have a method in my business logic layer that accepts a stream, which
I have this file that I am uploading to the server via php file
I have found numerous examples on uploading a file to a web server via
I saw that lots of people have Problems uploading a file in a test
I have a flash embedded, it is required for uploading a file and i
In my project I have a file uploading feature. Files are uploaded via FTP.
I have form for file uploading in my website that i check mime-type of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.